Reputation: 1
I have this code to toggle the panel div which works fine however whithin it are reg & login forms, when error text is generated and the page reloads i want the toggle to stay open... it does in all browsers apart from IE is there a fix for this?
<% if errTxt_slide > "" or errTxt_lin > "" then %>
<script language="javascript">
$(document).ready(function() {
$("#panel").slideToggle("fast");
$(this).toggleClass("active"); return false;
});
Upvotes: 0
Views: 53
Reputation: 1207
Without seeing more code, I would guess that jQuery is unsure of what $(this)
is. Are you able to reference the id
or some other identifier for div
? For instance:
$(document).ready(function() {
$("#panel").slideToggle("fast");
$("#panel").toggleClass("active");
});
Note that I also removed the return false;
as I see no need for it in the above code. You code will simply run when the page is loaded. It does not need to return anything.
Upvotes: 3