This is part of my code. Whenever I click on a div I want some things to happen.
There is some problem with the function xyz as alert(“good”) is not showing.
$("#subarea").click(function(e)
{
$('.pointer').removeClass("pointer").addClass("hiddenpointer");
$('.visible').css('z-index','1');
$('.hiddenimg').css('z-index','2');
$('#closeit').css('z-index','4');
$('.popupbox').css('display','none');
alert("hey");
xyz();
alert("good");
});
There are some links in my code with class “pointer1”. I want to shift them to a new position on click of a mouse for which I am using this function.
function xyz()
{
alert("idiot");
var elem = document.getElementsByClassName('pointer1');
for (var i = 0;i < elem.length; i++)
{
top1=elem[i].css('top');
alert(top1);
left1=elem[i].css('left');
top1=top1*4;
left1=left*5/3;
elem[i].css({left:left1,top:top1}).show();
}
}
Got it working here is the fiddle http://jsfiddle.net/pgBcW/34/ , your code contained many errors
NOTE: Be careful next time while coding.