February 1, 2012
February 1, 2012
<style>
ul {list-style:none;margin:0;padding:0;}
li {float:left;width:100px;line-height:25px;height:25px;margin:0;padding:0;text-align:center;}
li a {background:url(背景圖片) repeat 0 0;display:block;padding:5px 10px;color:#FFF;text-decoration:none;border-right:1px solid #FFF;}
</style>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="jquery.bgpos.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('li a')
.css( {backgroundPosition: "-20px 35px"} ) //デフォルト時、背景画像を横-20px、縦35pxに指定。
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
//マウスオーバー時に縦位置94pxに0.5秒かけて移動
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
//マウスアウト時に横位置40px、縦位置35pxに2秒かけて移動
$(this).css({backgroundPosition: "-20px 35px"})
//移動完了後、元の位置に戻す
}})
})
});
</script>
ul {list-style:none;margin:0;padding:0;}
li {float:left;width:100px;line-height:25px;height:25px;margin:0;padding:0;text-align:center;}
li a {background:url(背景圖片) repeat 0 0;display:block;padding:5px 10px;color:#FFF;text-decoration:none;border-right:1px solid #FFF;}
</style>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="jquery.bgpos.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('li a')
.css( {backgroundPosition: "-20px 35px"} ) //デフォルト時、背景画像を横-20px、縦35pxに指定。
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
//マウスオーバー時に縦位置94pxに0.5秒かけて移動
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
//マウスアウト時に横位置40px、縦位置35pxに2秒かけて移動
$(this).css({backgroundPosition: "-20px 35px"})
//移動完了後、元の位置に戻す
}})
})
});
</script>
html中放置
<ul id="demo">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
備註:詳細可參考demo中CSS ID+Script的作法,可分好幾種動畫。
$('#a a')
.css( {backgroundPosition: "-20px 35px"} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
$(this).css({backgroundPosition: "-20px 35px"})
}})
})
.css( {backgroundPosition: "-20px 35px"} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
$(this).css({backgroundPosition: "-20px 35px"})
}})
})
出處:
http://snook.ca/technical/jquery-bg/
參考:
http://www.skuare.net/test/jBgpos.html
demo:
http://apao.zapto.org/~apao/jQuery/Background_Position/
February 1, 2012
下載以下各個.js後,放入[head]~[/head]之間
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.js"></script>
<script type="text/javascript" src="jquery.easing.1.3.js"></script>
<script type="text/javascript" src="jquery.hoverIntent.minified.js"></script>
<script type="text/javascript" src="jquery.flashyNav.1.0.js"></script>
<script type="text/javascript">
$(function(){
$('.nav1').flashyNav({
rolloverColor: '#5400ff', //the default color of the rollover element
rolloverDuration: 1000, //the default duration for the rollover
easingMethod: 'easeInOutQuint' //easing method used for animation
});
$('.nav2').flashyNav({
rolloverColor: '#00d2ff', //the default color of the rollover element
rolloverDuration: 800, //the default duration for the rollover
easingMethod: 'easeOutBounce' //easing method used for animation
});
$('.nav3').flashyNav({
rolloverColor: '#a800ff', //the default color of the rollover element
rolloverDuration: 800, //the default duration for the rollover
easingMethod: 'easeOutElastic' //easing method used for animation
});
});
</script>
<style type="text/css">
* {margin:0; padding:0}
body {background: #000; color:#fff; margin:20px; font-family:Arial, Helvetica, sans-serif; font-size:11px}
a {color:#fff}
ul.nav {list-style:none; margin:20px; width:300px; font-size:10px; font-family:Arial, Helvetica, sans-serif; font-weight:bold}
ul.nav li {position:relative; border-bottom:1px solid #333; display:block; height:30px; overflow:hidden}
ul.nav li a {position:relative; color:#fff; text-decoration:none; display:block; height:20px; padding:10px 0 0 10px; z-index:100; text-transform:uppercase}
</style>
<script type="text/javascript" src="jquery.easing.1.3.js"></script>
<script type="text/javascript" src="jquery.hoverIntent.minified.js"></script>
<script type="text/javascript" src="jquery.flashyNav.1.0.js"></script>
<script type="text/javascript">
$(function(){
$('.nav1').flashyNav({
rolloverColor: '#5400ff', //the default color of the rollover element
rolloverDuration: 1000, //the default duration for the rollover
easingMethod: 'easeInOutQuint' //easing method used for animation
});
$('.nav2').flashyNav({
rolloverColor: '#00d2ff', //the default color of the rollover element
rolloverDuration: 800, //the default duration for the rollover
easingMethod: 'easeOutBounce' //easing method used for animation
});
$('.nav3').flashyNav({
rolloverColor: '#a800ff', //the default color of the rollover element
rolloverDuration: 800, //the default duration for the rollover
easingMethod: 'easeOutElastic' //easing method used for animation
});
});
</script>
<style type="text/css">
* {margin:0; padding:0}
body {background: #000; color:#fff; margin:20px; font-family:Arial, Helvetica, sans-serif; font-size:11px}
a {color:#fff}
ul.nav {list-style:none; margin:20px; width:300px; font-size:10px; font-family:Arial, Helvetica, sans-serif; font-weight:bold}
ul.nav li {position:relative; border-bottom:1px solid #333; display:block; height:30px; overflow:hidden}
ul.nav li a {position:relative; color:#fff; text-decoration:none; display:block; height:20px; padding:10px 0 0 10px; z-index:100; text-transform:uppercase}
</style>
January 29, 2012
January 29, 2012
January 19, 2012
前一陣子一直與中華電信溝通,溝通未何為何我的伺服器無法寄到hinet的信箱。
前後至少十通以上,每通電話幾乎都在20分鍾以上...
最後發現問題了,客服人員說因為,在中華電信機方內掛了趨勢科技的防毒設備,
我使用Mac又使用Synology的主機,未何有病毒反應呢?
幾通之後,他們通知我說我的伺服器不是固定IP的原因...
幾通之後,客服又打來:
您的固定IP是浮動IP...所以沒辦法寄到hinet.net的信箱
我的回覆:DDNS是什麼?不是動態DNS嗎?
我的IP之上一堆虛擬伺服器的DNS設定,照您們說的,我的DNS不就指定不到了?
客服回應:實在是對不起...
幾通之後,客服又打來:
是So-net的問題,要我與So-net伺服器管理員連絡,請與他們聯絡做處理...
我的回覆:
我的伺服器的DNS協定是TWNIC做的,不是So-net...
客服回應:這不是我們能夠做的決策...
更扯的是:
對方來的信件內容:(現在的病毒來自FB?)