swaggrK
asked on
Javascript delay when
On my website the following javascript successfully hides the <div> within my page BUT there seems to be a delay and so the image flashes for a brief second. Can someone assist me with rewriting this script so that the image does not appear at all.
A little more information. The reason for this div is so that an image I have on my blog only appears on the home page and NOT when
the user clicks page 2, 3, etc.
Script in header.
Code within page that hides div.
A little more information. The reason for this div is so that an image I have on my blog only appears on the home page and NOT when
the user clicks page 2, 3, etc.
Script in header.
<script type="text/javascript">
$(function () {
if (document.location.href.indexOf('PageID') > -1) {
$('#hideme').hide();
$('#hideme2').hide();
$('#hideme3').hide();
$('#showme').show();
/*
alert("Hey, you have selected to hide a div based on the URL parameters. Way to go!");
*/
} else {
/*
alert("You haven't done anything cool yet. Check out the text on this page to see some nifty changes.");
$('#hideme').show();
*/
}
});
</script>
Code within page that hides div.
<div id="hideme2">
<image>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER