Slide toggle from right-to-left and left-to-right.
This is the version #1 of the DEMO
HTML
<div id="myDiv">
<p id="myDivPar"></p>
</div>
CSS
#myDiv {
color:Green;
background-color:#eee;
border:2px solid #333;
display:none;
bottom:0px;
margin-bottom:0px;
width:300px;
bottom:50px;
left:50px;
position: absolute;
}
#myDiv p {
margin: 15px;
font-size: 0.917em;
}
JavaScript
var i = 0;
var iDataSetRows = 2;
function slideNow()
{
i++;
var sTextToShow = '';
if (i == 1) sTextToShow = 'hejsan';
else if (i == 2) sTextToShow = 'svejsan';
// Set the effect type
var effect = 'slide';
// Set the options for the effect type chosen
var options = { direction: 'down'};
// Set the duration (default: 400 milliseconds)
var duration = 500;
document.getElementById("myDivPar").innerHTML = sTextToShow + ' ' + i;
$('#myDiv').toggle(effect, options, duration);
}
setInterval(myMethod, 3000);
function myMethod()
{
slideNow();
}