1. Yes its possible:
<script type="text/javascript">
jQuery(document).ready(function(){
setInterval(function() {
jQuery('#tinydiv1, #tinydiv2').slideDown(time).delay(time).slideUp(time);
}, time);
});
</script>
2. There are a lot of ways to do it sideways sideways
One approach is to change the div's css and another is the one I prefer using jQuery:
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
#d1,#d2 { display:none; } #d1 {background: blue; margin:10px 0px;} #d2 {background: red; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<body>
<div id="d1">I am div 1.</div>
<div id="d2">Div 2 here.</div>
<script type="text/javascript">
jQuery(document).ready(function(){
setInterval(function() {
jQuery('#d1, #d2').show("slide", { direction: "right" }, 1000).delay(4000).hide("slide", { direction: "left" }, 1000);
}, '2000');
});
</script>
</body>
</html>
You can copy the whole thing and see. Use also CDNs for jQuery and jQueryUI to load faster in the user end.