I am using jQuery to hide a div via hide()
.
Then when a link is clicked it will show the div
, but for some reason it will not stay.
it will show for a ms then disappear.
HTML
<div id="introContent">
<h1 id="introText">Welcome</h1>
<p id="introParagraph">I create <strong>Responsive</strong>, <strong>Interactive</strong>, <strong>Beautiful</strong> Mobile ready Websites.
Every Website is created from scratch for each client so no Two Projects are alike.
Please read more about my Company and our work.
"High Quality Work at Affordable Prices"
</p>
</div>
jQuery
$(function() {
$("#introContent").hide();
$("#intro").click(function () { //$(#intro) is a link in my nav bar
$("#introContent").show();
});
});
Stop the browser from doing the default action of the element you are clicking. Cancel the click
$(function() {
$("#introContent").hide();
$("#intro").click(function (evt) {
evt.preventDefault();
$("#introContent").show();
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With