Dynamic change .click value Jquery IE issue.

Posted by user326100 on Stack Overflow See other posts from Stack Overflow or by user326100
Published on 2010-04-26T15:02:16Z Indexed on 2010/04/26 15:03 UTC
Read the original article Hit count: 173

Filed under:
|
|
|

Hello guys.. it's i first time i'm asking here. Sorry if the answer is available already.

I have a very small jQuery script that canges the paramether for onclick attr on a DIV.

IT works like as right and left arrows for some content in the middle.

BAsically i set the onclick="foo(1)" then when get clicked sld change the value 1 to 2, and keep changing everytime i click.

on jQuery functio i'm using: $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next);

it works like a charm on FF and Chrome, but does not work on IE !!!! Argh...

here the the code: if (start == 24) { var a = 0; var b = 0; } else { var a = start-6; var b = start+6; }

next = "home_featured_videos(" + b + ");"; newclick_next = eval("(function(){"+next+"});");

prev = "home_featured_videos(" + a + ");"; newclick_prev = eval("(function(){"+prev+"});");

$('#video-module').css('background',''); $('#video-module').html(response);

$("#v_arrow_l").attr('onclick','').unbind().click(newclick_prev); $("#v_arrow_r").attr('onclick','').unbind().click(newclick_next);

The html:

//CONTENT

So like i said.. i define the attr onclick when page open. It work well on IE. but when i click the arrow and call the function the oncli is set to null and i add the function to .click. IE stop working. the click is dead.

If anybody have idea why this is happening.

Thanx in advance. Kind Regards

Varois

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ie