javascript - Issue with jQuery hide() using Firefox -
i have problem hide()
function on page making. @ moment, selected div layer not hiding.
it works fine in safari , chrome, unfortunately not in firefox :-(
the page here in context: http://www.upreach.org.uk/undergraduates/partners.php , here's code:
$(document).ready(function(){ $('div.partner-employers').not('div#start').hide(); $("a.employers").click(function(){ $("a.employers").css("font-weight", "normal"); $(this).css("font-weight", "bold"); var myelement2 = $(this).attr("href") $(myelement2).fadein("fast"); event.preventdefault(); $(".partner-employers:visible").not(myelement2).hide(); }); });
...and html:
<a href="#1" class="employers">1</a><br/> <a href="#2" class="employers">2</a><br/> <a href="#3" class="employers">3</a><br/> <div class="partner-employers" id="1">content 1</div> <div class="partner-employers" id="2">content 2</div> <div class="partner-employers" id="3">content 3</div>
thanks in advance can give...
you using undefined event
variable, code crashes before last line can executed. in ie defined in window
object, not in other browsers.
define event
parameter in function signature:
$("a.employers").click(function(event){
Comments
Post a Comment