0
OK,我使用這個代碼:jQuery的onload事件翻轉格
<script type="text/javascript">
$(function() {
$("#flipPad a:not(.revert)").bind("click",function() {
var $this = $(this);
$("#flipbox").flip({
direction: $this.attr("rel"),
color: $this.attr("rev"),
content: $this.attr("title"), //(new Date()).getTime(),
onBefore: function(){$(".revert").show()}
});
return false;
});
$(".revert").bind("click",function() {
$("#flipbox").revertFlip();
return false;
});
var changeMailTo = function() {
var mArr = ["@","smashup","luca",".it"];
$("#email").attr("href","mailto:"+mArr[2]+mArr[0]+mArr[1]+mArr[3]);
}
$(".downloadBtn").click(function() {
pageTracker._trackPageview("download_flip");
});
setTimeout(changeMailTo,500);
});
</script>
這樣做是什麼,當我點擊flipPad按鈕時,flipbox恢復DEMO
現在我想做的是翻轉div,但自動。
我想這一點,但沒有奏效:
<script>
$(document).ready(function() {
$("#flipbox").flip({
direction: $this.attr("rel"),
color: $this.attr("rev"),
content: $this.attr("title"), //(new Date()).getTime(),
onBefore: function(){$(".revert").show()}
});
});
</script>
的rel = 「BT」 轉= 「#B0EB17」 稱號= 「 '$文本2'。」 –
好,因爲屬性值(方向,顏色,內容)來自被點擊的鏈接,你將如何在頁面加載中定義這些屬性? –