Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total = 83;
- show = 5;
- current = 2;
- left = 0;
- index = 0;
- $(document).ready(function(){
- for (var i = 0 ; i < 5 ; i++)
- {
- image(i);
- $("#caroussel img").eq(i)
- .css("position", "absolute")
- .css("left", left+"px")
- .css("z-index",index);
- left += 150;
- if (i < 2)
- index++;
- else
- index--;
- }
- });
- function image(id)
- {
- $("#caroussel").append("<img id='image"+id+"'/>");
- $.post(
- "imageUrl.php",
- {
- "n":current,
- "id":id
- },
- function (data) {
- var id_name = "#image"+id;
- $(id_name).attr("src",data.url);
- },
- "json"
- );
- }
Add Comment
Please, Sign In to add comment