Scrolling Text “Ultrabook Notebook Tipis Harga Murah Terbaik” using jQuery


Scrolling Text “Ultrabook Notebook Tipis Harga Murah Terbaik” using jQuery

paste this code

<body>
<!–
source
visit : http://www.kevinmusselman.com/2009/10/scrolling-text-jquery-animate/
–>
<script type=”text/javascript” src=”http://www.google.com/jsapi”></script&gt;
<script type=”text/javascript”>
google.load(“jquery”, “1.3.2”);
</script>

<!– Scrolling Text to the Left –>
<div id=”scrollwrapper” style=”overflow:hidden; border:1px solid #004F72;
position:relative; width:500px; height:20px;”>
<div style=”width:5000px;”>
<span id=”scrollcontent” style=”position:absolute; left:500px;”>
<span id=”firstcontent” style=”float:left; text-align:left;”>
Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik
</span>
</span>
</div>
</div>

<!–Scrolling Text Up–>
<div id=”scrolltextup” style=”border:1px ridge #004F72; overflow:hidden;
position:relative; width:500px; height:20px;”>
<div id=”textup” style=”text-align:center; position:absolute; top:0;
left:0; width:500px;”>
<div style=”line-height:20px;”>
Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik, Ultrabook Notebook Tipis Harga Murah Terbaik
</div>
</div>
</div><br />
<script type=”text/javascript” src=”animate.js”></script>
</body>

save this code animate.js

$(“#textwrapper”).css({“display”:”block”});
var scrollwidth = $(“#textwidth”).width();
$(“#textwrapper”).remove();
var scrollwrapperwidth = $(“#scrollwrapper”).width();
if(scrollwidth < scrollwrapperwidth) scrollwidth = scrollwrapperwidth;
var noappend = 0;
$(“#scrollcontent”).css({“width”:scrollwidth});
$(“#firstcontent”).css({“width”:scrollwidth});
var appending = scrollwrapperwidth-scrollwidth;

function animatetext(rate){
var starttime = new Date();
var dist = scrollwidth+parseFloat($(“#scrollcontent”).css(“left”));
if(!rate)rate = 1;
var duration = Math.abs(dist/(rate/100));
$(“#scrollcontent”).animate({“left”:”-“+scrollwidth},{
step: function() {
if(parseFloat($(“#scrollcontent”).css(“left”))< parseFloat(appending) && !noappend){
noappend = 1;
$(“#scrollcontent”).css({“width”:scrollwidth+scrollwidth});
$(“#scrollcontent”).append(“<span style=\’float:left; text-align:left; width:”+scrollwidth+”px;\’>”+$(“#scrollcontent”).children(“:first”).html()+”</span>”);
}
},
duration: duration,
easing: “linear”,
complete:function(){
$(“#scrollcontent”).children(“:first”).remove();
$(“#scrollcontent”).css({“left”:0});
$(“#scrollcontent”).css({“width”:scrollwidth});
noappend=0;
animatetext(6);
}
});
}
$(“#scrollcontent”).mouseover(function(e){
$(“#scrollcontent”).stop();
});
$(“#scrollcontent”).mouseout(function(e){
animatetext(6);
});

var scrollheight = $(“#textup”).height();

function scrolltextup(speed){
$(“#textup”).animate({“top”:”-=20″},{
duration: speed,
easing: “linear”,
complete:function(){
$(“#textup”).children(“:last”).after(“<div style=’line-height:20px;’>”+$(“#textup”).children(“:first”).html()+”</div>”);
var fcheight = parseInt($(“#textup”).css(“top”));
if($(“#textup”).children(“:first”).height() <= (parseInt($(“#textup”).css(“top”))*-1)){
$(“#textup”).children(“:first”).remove();
$(“#textup”).css({“top”:0});
}
setTimeout(“scrolltextup(3000)”, 500);
}
});
}

$(document).ready(function(){
if(scrollheight>20)
setTimeout(“scrolltextup(3000)”, 600);
animatetext(6);
});

just share, thank
visit: newbie programmer

https://fourteam.wordpress.com/2011/12/19/ultrabook-notebook-tipis-harga-murah-terbaik/

Target Keyword: Ultrabook Notebook Tipis Harga Murah Terbaik

Iklan

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s