Safari for iPhone can't evaluate correctly jQuery? -
i'm trying make work functionality exists on website works bad on safari iphone.
well, have "li" element:
.. <li><input id='showorhide' type='button' value='show or hide'/></li> <li><input type='text' value='ok'/></li> ..
when click on 'show or hide' button, text input should appear or disappear.
then, have jquery function binds click:
$("#showorhide").click(function(){ if($(this).parent().next().is(':visible')) $(this).parent().next().hide('slow'); else $(this).parent().next().show('slow'); });
the problem that, if element appears, safari hides shows it.
so think safari checks wether element visible or not. if it's visible, hides it, go "else" selection. there, checks if element visible or not. find it's not visible, make appear.
is there solution without using extrernal javascript framework (but jquery) ?
thanks, regards
well, make code lot simpler using jquery toggle function show/hide element.
not sure if fix issue seeing...
the code be:
$("#showorhide").click(function(){ $(this).parent().next().toggle('slow'); });
Comments
Post a Comment