iT邦幫忙

0

請問這個網頁上的http://www.sunte.com.tw/category.php?id=12 商品選項變色

請問這個商業網頁上的http://www.sunte.com.tw/category.php?id=12 商品選項用滑鼠點選時要變色請問要在哪邊改阿!這是ECSHOP

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
0
0324
iT邦新手 1 級 ‧ 2010-03-23 12:11:53

Dreamweaver 裡面的行為

2
mybeldandy
iT邦研究生 5 級 ‧ 2010-03-23 17:56:02

如果你要文字變色

<pre class="c" name="code">
<script type="Text/Javascript" language="JavaScript">
<!--

    var aaaaa = document.getElementById("pageIn");
	var bbbbb = aaaaa.getElementsByTagName("form")[0];
	var ccccc = bbbbb.previousSibling.previousSibling;
	
    var eeeee = document.getElementById("container");
    var fffff = eeeee.getElementsByTagName("div");

	var wantid = -1;
	for (iii = 0;iii < fffff.length;iii++)
	{
	    if (fffff[iii].id == "history_div")
        {
		    wantid = iii - 1;
			break;
		}
	}
	
	var ggggg = fffff[wantid].getElementsByTagName("a");
	
	for (jjj = 0;jjj < ggggg.length;jjj++)
	{
	    if (ggggg[jjj].href == ccccc.href)
        {
			ggggg[jjj].style.color = "red";
			break;
		}
	}

//-->
</script>

如果你要點過變色 自己去改CSS
http://www.sunte.com.tw/themes/lativ/style.css

mybeldandy iT邦研究生 5 級 ‧ 2010-03-23 17:56:33 檢舉

喔 上面那些CODE貼在最下面

foxgroge iT邦新手 4 級 ‧ 2010-03-29 14:47:05 檢舉

http://www.sunte.com.tw/category.php?id=2 滑鼠點下去文字顏色改變的語法也依樣ㄇ!! 幫朋友代問的

0
ghyzsing
iT邦新手 5 級 ‧ 2015-02-21 19:48:18

附上講解版

<pre class="c" name="code">
<style>
#aid{
    cursor:pointer;  /*讓鼠標成為手指圖案*/
}

/*「#aid」代表搜尋「id」為「aid」的元素,「:hover」代表「滑鼠移入時」*/
#aid:hover{  
    color:blue;  /*讓滑鼠移入時,文字改變顏色*/
}
</style>


<a id="aid">hello world</a> 


<!-- 滑鼠點下去文字顏色改變可以使用jquery的click() -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
$("#aid").click(function(){
     //當滑鼠點下時即觸發以下內容
     $(""#aid"").css("color","black");
})
</script>

以下為無講解版

<pre class="c" name="code">
<style>  
#aid{  
    cursor:pointer;
}  
#aid:hover{    
    color:blue; 
}  
</style>  
  
  
<a id="aid">hello world</a>   
  
  
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>  
<script>  
$("#aid").click(function(){  
     $(""#aid"").css("color","black");  
})  
</script> 

我要發表回答

立即登入回答