我一直在研究和学习越来越多关于HTML 5,JQuery,CSS3,以及在JavaScript被禁用或未被禁用时隐藏和禁用某些元素的能力.(<noscript>标签)
我的问题是,
HTML
很简单,如果JS被禁用,我会隐藏我的购物车区域并更改登录链接.
<!-- If JavaScript is disabled it will make the login link take you to a login page instead of a drop-down box. -->
<noscript>
<style>
.login-form, .js-enabled{
display: none;
}
.cart{
top: -80px;
}
</style>
<div class="cart">
<a href="#" id="cart_img">
<img src="img/bag.jpg" alt="Check Cart"
onmouseover="this.src='img/bag-gold.jpg'"
onmouseout="this.src='img/bag.jpg'">
</a>
<a href="#">Why HorseTack?</a> |
<a href="#">About</a> |
<a href="#">Contact</a> |
<a href="http://www.LOGINPAGELINK.com">Login</a>
</div>
</noscript>
<!-- …Run Code Online (Sandbox Code Playgroud)