FairyBusiness
asked on
HELP with undefined variable in my jquery??
Hi,
This was coming up undefined (in my web developer tools in firefox):
So I put these variables in an if statement because on another page they are needed.
So basically I am trying to say if this element exists on the page (article.slider) then set these variables. If not just ignore them. But they are still coming up undefined. Anyone know how to accomplish this??
This was coming up undefined (in my web developer tools in firefox):
var slider = $("article.slider");
var right = ($(slider).css("right")).length - 2;
var left = ($(slider).css("left")).length - 2;
So I put these variables in an if statement because on another page they are needed.
var slider = $("article.slider");
if (slider) {
var right = ($(slider).css("right")).length - 2;
var left = ($(slider).css("left")).length - 2;
}
So basically I am trying to say if this element exists on the page (article.slider) then set these variables. If not just ignore them. But they are still coming up undefined. Anyone know how to accomplish this??
ASKER
nope that didn't make a difference.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!! =)
Open in new window