jquery attr problem
Posted
by shanmugam
on Stack Overflow
See other posts from Stack Overflow
or by shanmugam
Published on 2010-06-14T06:55:19Z
Indexed on
2010/06/14
7:02 UTC
Read the original article
Hit count: 426
jQuery
|jquery-ajax
function rotateimg(ulid,showid,linkid) {
var cur = $("#"+ulid+" li.current");
var nxt = cur.next("li");
if (nxt.length == 0)
{
nxt = $("#"+ulid+" li:first");
}
cur.removeClass("current");
nxt.addClass("current");
var img_value=nxt.attr("id").substring(11);
var img_title=nxt.attr("title");
var img_id = nxt.attr("name").substring(17);
var alink=nxt.attr("rel");
$("#"+linkid).attr("href",alink);
$("#"+ulid+" li div").css("background-color", "#000000");
nxt.find("div").css("background-color", "#333333");
setimg(img_value,showid,img_title);
}
var lt=setInterval("rotateimg('lnews','show_images_event','lnewslink')", 5000);
in this code. i am getting this error nxt.attr("id") is undefined
pls any one help me
© Stack Overflow or respective owner