0
我基本上要爲訪問者能夠點擊的圖片和背景更改頁X但其餘鏈接到網頁Y.更改後臺發送鏈接
我想我的WordPress網站下面要說的:
如果第1個顯示,代碼X的if else改變爲
HTML
<div class="box1">
<ul id="bgbg">
<li id="bg1"><a href="#"></a> </li>
<li id="bg2"><a href="#"></a> </li>
<li id="bg3"><a href="#"></a> </li>
<?php if (is_page ('1')){?>
<script>
jQuery(document).ready(function() {
jQuery("#bgbg > li").click(function() {
jQuery('body').removeClass('bg1 bg2 bg3');
jQuery('body').addClass(jQuery(this).attr('id')) ; });});
</script>
<?php } else { ?>
<script>
?!??
</script>
我嘗試:
<script>
jQuery(document).ready(function() {
jQuery("#bgbg a").attr("href", "http://www.google.com");
});
</script>
非常感謝您
您可能需要使用'了window.location = 「http://www.yoururl.com」;' – Shubanker