Monday, October 29, 2012

(HRESULT: 0x80070057 (E_INVALIDARG)) on debug

(HRESULT: 0x80070057 (E_INVALIDARG)) on debug


Issue:
When trying to debug an ASP.net website in Visual Studio you get the following error message:

Could not load file or assembly 'your project' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

Solution:
Clear out the temporary framework files for your project in:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

Update:

For Windows 7, the path is:
C:\Users\[username]\AppData\Local\Temp\Temporary ASP.NET Files\

For 64 bit systems with 'Framework' in the path the full path is:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\

Wednesday, October 24, 2012

Jquery scroll to a list or div item


The $innerListItem.position().top is actually relative to the .scrollTop() of its first positioned ancestor. So the way to calculate the correct $parentDiv.scrollTop() value is to begin by making sure that $parentDiv is positioned. If it doesn't already have an explicit position, use position: relative. The elements $innerListItem and all its ancestors up to $parentDiv need to have no explicit position. Now you can scroll to the $innerListItem with:
// Scroll to the top
$parentDiv.scrollTop($parentDiv.scrollTop() + $innerListItem.position().top);

// Scroll to the center
$parentDiv.scrollTop($parentDiv.scrollTop() + $innerListItem.position().top
    - $parentDiv.height()/2 + $innerListItem.height()/2);

Monday, October 22, 2012

Making an infinite JQuery carousel

http://web.enavu.com/tutorials/making-an-infinite-jquery-carousel/

Making an infinite JQuery carousel

In this tutorial we will make an infinite JQuery carousel. I noticed that most of tutorials on how to make an infinite JQuery carousel are quite complex, so i decided to show you how to make it much simpler.
DZoneDiggDesign FloatDeliciousBlinklistRedditFacebookGoogle BuzzTwitterStumbleUponTumblrShare
How will it work?
We will use an unordered list for our carousel items, which will be placed inside a div with overflow:hidden css property so all items beyond limits of the div will be hidden.
The infinite effect will be made by changing position of the items, when the user clicks right(next) the first item will be placed after the last item and when he clicks left(previous) the last item will be placed before the first item.
There are many ways to make this effect but i choosed this one, because i think it’s the easiest to understand.

Demo Source

HTML

carousel_1
  1. <div id='carousel_container'>
  2. <div id='left_scroll'><img src='left.png' /></div>
  3. <div id='carousel_inner'>
  4. <ul id='carousel_ul'>
  5. <li><a href='#'><img src='item1.png' /></a></li>
  6. <li><a href='#'><img src='item2.png' /></a></li>
  7. <li><a href='#'><img src='item3.png' /></a></li>
  8. <li><a href='#'><img src='item4.png' /></a></li>
  9. <li><a href='#'><img src='item5.png' /></a></li>
  10. </ul>
  11. </div>
  12. <div id='right_scroll'><img src='right.png' /></div>
  13. </div>

CSS

  1. #carousel_inner {
  2. float:left; /* important for inline positioning */
  3. width:630px; /* important (this width = width of list item(including margin) * items shown */
  4. overflow: hidden; /* important (hide the items outside the div) */
  5. /* non-important styling bellow */
  6. background: #F0F0F0;
  7. }
  8. #carousel_ul {
  9. position:relative;
  10. left:-210px; /* important (this should be negative number of list items width(including margin) */
  11. list-style-type: none; /* removing the default styling for unordered list items */
  12. margin: 0px;
  13. padding: 0px;
  14. width:9999px; /* important */
  15. /* non-important styling bellow */
  16. padding-bottom:10px;
  17. }
  18. #carousel_ul li{
  19. float: left; /* important for inline positioning of the list items */
  20. width:200px; /* fixed width, important */
  21. /* just styling bellow*/
  22. padding:0px;
  23. height:110px;
  24. background: #000000;
  25. margin-top:10px;
  26. margin-bottom:10px;
  27. margin-left:5px;
  28. margin-right:5px;
  29. }
  30. #carousel_ul li img {
  31. .margin-bottom:-4px; /* IE is making a 4px gap bellow an image inside of an anchor (<a href...>) so this is to fix that*/
  32. /* styling */
  33. cursor:pointer;
  34. cursor: hand;
  35. border:0px;
  36. }
  37. #left_scroll, #right_scroll{
  38. float:left;
  39. height:130px;
  40. width:15px;
  41. background: #C0C0C0;
  42. }
  43. #left_scroll img, #right_scroll img{
  44. /*styling*/
  45. cursor: pointer;
  46. cursor: hand;
  47. }
I think only one of these properties needs to be explained further. The left margin of our unordered list is -210px. That’s because the last item will be moved before the first item, so we are setting the left margin to a negative number of the item’s width.
carousel_3
That’s how it looks. Everything is perfect.Now, the JQuery part…

JQuery

  1. $(document).ready(function() {
  2. //move the last list item before the first item. The purpose of this is if the user clicks previous he will be able to see the last item.
  3. $('#carousel_ul li:first').before($('#carousel_ul li:last'));
  4. //when user clicks the image for sliding right
  5. $('#right_scroll img').click(function(){
  6. //get the width of the items ( i like making the jquery part dynamic, so if you change the width in the css you won't have o change it here too ) '
  7. var item_width = $('#carousel_ul li').outerWidth() + 10;
  8. //calculate the new left indent of the unordered list
  9. var left_indent = parseInt($('#carousel_ul').css('left')) - item_width;
  10. //make the sliding effect using jquery's anumate function '
  11. $('#carousel_ul').animate({'left' : left_indent},{queue:false, duration:500},function(){
  12. //get the first list item and put it after the last list item (that's how the infinite effects is made) '
  13. $('#carousel_ul li:last').after($('#carousel_ul li:first'));
  14. //and get the left indent to the default -210px
  15. $('#carousel_ul').css({'left' : '-210px'});
  16. });
  17. });
  18. //when user clicks the image for sliding left
  19. $('#left_scroll img').click(function(){
  20. var item_width = $('#carousel_ul li').outerWidth() + 10;
  21. /* same as for sliding right except that it's current left indent + the item width (for the sliding right it's - item_width) */
  22. var left_indent = parseInt($('#carousel_ul').css('left')) + item_width;
  23. $('#carousel_ul').animate({'left' : left_indent},{queue:false, duration:500},function(){
  24. /* when sliding to left we are moving the last item before the first item */
  25. $('#carousel_ul li:first').before($('#carousel_ul li:last'));
  26. /* and again, when we make that change we are setting the left indent of our unordered list to the default -210px */
  27. $('#carousel_ul').css({'left' : '-210px'});
  28. });
  29. });
  30. });
That’s it. I think it’s very easy to understand how it works.
Related posts:
  1. Making a jQuery infinite carousel with nice features
  2. Making a Cool Spotlight Effect with jQuery
  3. Making A Cool Thumbnail Effect With Zoom And Sliding Captions
  4. Cool navigation menu made with JQuery
  5. Making Image Overlay Caption Using CSS

jquery实现图片左右滚动效果

http://www.jqueryba.com/342.html
function scroll(box,left,right,img,speed,or)
{
  var box = $(box);
  var left = $(left);
  var right = $(right);
  var img = $(img).find('ul');
  var w = img.find('li').outerWidth(true);
  var s = speed;
  left.click(function()
   {
img.animate({'margin-left':-w},function()
  {
   img.find('li').eq(0).appendTo(img);
   img.css({'margin-left':0});
   });
});
  right.click(function()
   {
img.find('li:last').prependTo(img);
img.css({'margin-left':-w});
img.animate({'margin-left':0});
});
  if (or == true)
  {
   ad = setInterval(function() { right.click();},s*1000);
   box.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { right.click();},s*1000);});
  }
}
scroll(".mallMiddleBottom",".mallLeftImg",".mallRightImg",".mallUl",3,true);

基于jQuery的图片展示(横向滚动,可左右控制)

http://blog.csdn.net/fengxuezhiye/article/details/7336678

基于jQuery的图片展示(横向滚动,可左右控制)

分类: WEB前端1807人阅读评论(0)收藏举报
今天在网上看了一个图片展示的实例,就整理一下贴了出来,为的是以后使用方便,也可以和大家一起分享。
下面是整个页面,如果要使用,只需把整个页面拷贝过去,然后修改图片路径,把jQuery的包也要放进去。
展示效果:

页面代码:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <title>jQuery 横向图片滚动,带左右控制</title>
  6. <style type="text/css">
  7. <!--
  8. *{margin:0; padding:0}
  9. li{list-style:none}
  10. img{border:0}
  11. body{background-color:#fff; font-size:12px; color:#2c2c2c; font-family:Arial, Helvetica, sans-serif}
  12. a{color:#444; text-decoration:none}
  13. a:hover{color:#900; text-decoration:underline}
  14. .con{overflow:hidden; margin:30px auto; width:442px; height:100%; padding:10px 15px; border:solid 1px #FCBA79; background-color:#FFFBEC;}
  15. #carousel_container{position:relative; height:100px; overflow:hidden;}
  16. #carousel_inner{width:391px; height:95px; overflow: hidden; position:absolute;left:25px; top:5px;}
  17. #left_scroll{position: absolute;left:0;top:43px;width:9px;height:9px;cursor: pointer;cursor: hand; background:url(images/left.gif) no-repeat;}
  18. #right_scroll{position: absolute;top:43px;right:0; width: 9px;height: 9px;cursor: pointer;cursor: hand; background: url(images/right.gif) no-repeat;}
  19. #carousel_ul{width:9999px; height:95px; position:relative;}
  20. #carousel_ul li{float: left;width:84px; height:86px; border:solid 1px #FEDDAB; margin-right:15px; display:inline;}
  21. -->
  22. </style>
  23. <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
  24. <script type="text/javascript">
  25. <!--
  26. var SellerScroll = function(options){
  27. this.SetOptions(options);
  28. this.lButton = this.options.lButton;
  29. this.rButton = this.options.rButton;
  30. this.oList = this.options.oList;
  31. this.showSum = this.options.showSum;
  32. this.iList = $("#" + this.options.oList + " > li");
  33. this.iListSum = this.iList.length;
  34. this.iListWidth = this.iList.outerWidth(true);
  35. this.moveWidth = this.iListWidth * this.showSum;
  36. this.dividers = Math.ceil(this.iListSum / this.showSum); //共分为多少块
  37. this.moveMaxOffset = (this.dividers - 1) * this.moveWidth;
  38. this.LeftScroll();
  39. this.RightScroll();
  40. };
  41. SellerScroll.prototype = {
  42. SetOptions: function(options){
  43. this.options = {
  44. lButton: "left_scroll",
  45. rButton: "right_scroll",
  46. oList: "carousel_ul",
  47. showSum: 4 //一次滚动多少个items
  48. };
  49. $.extend(this.options, options || {});
  50. },
  51. ReturnLeft: function(){
  52. return isNaN(parseInt($("#" + this.oList).css("left"))) ? 0 : parseInt($("#" + this.oList).css("left"));
  53. },
  54. LeftScroll: function(){
  55. if(this.dividers == 1) return;
  56. var _this = this, currentOffset;
  57. $("#" + this.lButton).click(function(){
  58. currentOffset = _this.ReturnLeft();
  59. if(currentOffset == 0){
  60. for(var i = 1; i <= _this.showSum; i++){
  61. $(_this.iList[_this.iListSum - i]).prependTo($("#" + _this.oList));
  62. }
  63. $("#" + _this.oList).css({ left: -_this.moveWidth });
  64. $("#" + _this.oList + ":not(:animated)").animate( { left: "+=" + _this.moveWidth }, { duration: "slow", complete: function(){
  65. for(var j = _this.showSum + 1; j <= _this.iListSum; j++){
  66. $(_this.iList[_this.iListSum - j]).prependTo($("#" + _this.oList));
  67. }
  68. $("#" + _this.oList).css({ left: -_this.moveWidth * (_this.dividers - 1) });
  69. } } );
  70. }else{
  71. $("#" + _this.oList + ":not(:animated)").animate( { left: "+=" + _this.moveWidth }, "slow" );
  72. }
  73. });
  74. },
  75. RightScroll: function(){
  76. if(this.dividers == 1) return;
  77. var _this = this, currentOffset;
  78. $("#" + this.rButton).click(function(){
  79. currentOffset = _this.ReturnLeft();
  80. if(Math.abs(currentOffset) >= _this.moveMaxOffset){
  81. for(var i = 0; i < _this.showSum; i++){
  82. $(_this.iList[i]).appendTo($("#" + _this.oList));
  83. }
  84. $("#" + _this.oList).css({ left: -_this.moveWidth * (_this.dividers - 2) });
  85. $("#" + _this.oList + ":not(:animated)").animate( { left: "-=" + _this.moveWidth }, { duration: "slow", complete: function(){
  86. for(var j = _this.showSum; j < _this.iListSum; j++){
  87. $(_this.iList[j]).appendTo($("#" + _this.oList));
  88. }
  89. $("#" + _this.oList).css({ left: 0 });
  90. } } );
  91. }else{
  92. $("#" + _this.oList + ":not(:animated)").animate( { left: "-=" + _this.moveWidth }, "slow" );
  93. }
  94. });
  95. }
  96. };
  97. $(document).ready(function(){
  98. var ff = new SellerScroll();
  99. });
  100. //-->
  101. </script>
  102. </head>
  103. <body>
  104. <div class="con">
  105. <div id="carousel_container">
  106. <div id="left_scroll"></div>
  107. <div id="carousel_inner">
  108. <ul id="carousel_ul">
  109. <li><img src="images/wall_s1.jpg" border="0"></li>
  110. <li><img src="images/wall_s2.jpg" border="0"></li>
  111. <li><img src="images/wall_s3.jpg" border="0"></li>
  112. <li><img src="images/wall_s4.jpg" border="0"></li>
  113. <li><img src="images/wall_s5.jpg" border="0"></li>
  114. <li><img src="images/wall_s6.jpg" border="0"></li>
  115. <li><img src="images/wall_s7.jpg" border="0"></li>
  116. <li><img src="images/wall_s1.jpg" border="0"></li>
  117. <li><img src="images/wall_s2.jpg" border="0"></li>
  118. <li><img src="images/wall_s3.jpg" border="0"></li>
  119. <li><img src="images/wall_s4.jpg" border="0"></li>
  120. <li><img src="images/wall_s5.jpg" border="0"></li>
  121. <li><img src="images/wall_s1.jpg" border="0"></li>
  122. <li><img src="images/wall_s2.jpg" border="0"></li>
  123. <li><img src="images/wall_s3.jpg" border="0"></li>
  124. </ul>
  125. </div>
  126. <div id="right_scroll"></div>
  127. </div>
  128. </div>
  129. </body>
  130. </html>

simple jQuery crossfade of images

http://www.simonbattersby.com/blog/simple-jquery-image-crossfade/
I wanted a simple jQuery crossfade effect for an image cycler last week, and surprisingly couldn’t find anything suitable. So I ended up writing my own, and here it is. Tested in IE6/7/8, Firefox 3, Chrome, Opera 9/10, Safari 4, all on Windows XP, and Safari 5 on Mac OS X/Snow Leopard.

The demo

Hoverfly on a green leafFly on a pink flowerInsect on a leafFly

The code

You need the following basic html:
<div id="portfolio_cycler">
<img class="active" src="image1.jpg" alt="My image" />
<img src="image2.jpg" alt="My image" /> 
<img src="image3.jpg" alt="My image" /> 
<img src="image4.jpg" alt="My image" />  
</div>
Here’s the necessary css – just to show the z-index and positioning – you’ll need to add some more to position as required:
#portfolio_cycler{position:relative;}
#portfolio_cycler img{position:absolute;z-index:1}
#portfolio_cycler img.active{z-index:3}
And here’s the javascript:
function cycleImages(){
      var $active = $('#portfolio_cycler .active');
      var $next = ($active.next().length > 0) ? $active.next() : $('#portfolio_cycler img:first');
      $next.css('z-index',2);//move the next image up the pile
      $active.fadeOut(1500,function(){//fade out the top image
   $active.css('z-index',1).show().removeClass('active');//reset the z-index and unhide the image
          $next.css('z-index',3).addClass('active');//make the next image the top one
      });
    }

$(document).ready(function(){
// run every 7s
setInterval('cycleImages()', 7000);
})

The logic

All the images are loaded with the page and positioned absolutely on top of each other, all with z-index=1. One image is initially set with a class of “active”, which is positioned on the top of the stack with z-index = 3.
Then, using jQuery, I’m identifying the active image, and then the next image down. I’m doing this via the jQuery .next() method. If there isn’t a next image – if we’re at the end of the images – I’m selecting the first image instead using .first().
Now, once I’ve identified the next image, I’m assigning z-index=2 to this so it’s the second image down in the pile – and hence is visible when the top image fades out.
Then, I’m fading out the active image. When this completes there’s a few things to do. First, I’m setting the z-index of the active image (now faded out) back to z-index=1. Then, I’m reversing the fade by using the show() method. It won’t be visible now because of the z-index. Finally, I’m removing the active class. Effectively, I’m putting this image back into the bottom pile.
Nearly there. Then, with the next image, which is now on top anyway, I’m assigning z-index=3, and then adding the active class to this image.
Finally, all of this code is sitting in a function which I’m calling every seven seconds via setInterval().

Variations on the basic crossfade

Here are a few variations, mostly built in response to questions or comments on the basic code. View the source to see how they’re done.
Cycle through images once and then stop
Multiple cyclers on a page (with a common periodicity)
Multiple cyclers on a page (with different periodicity)
Multiple cyclers with slideshow controls

Saturday, October 20, 2012

Create Dropdownlist with jquery



<div id="SelectedCity" style="left:300px; padding-left:15px; padding-top:5px;background-image:url(../DropDown.jpg);  color: #8f8f8f; font-size: 16px; width: 340px;
        height: 25px">
        Select your city
    </div>
    <div id="Cities"  style=" left:300px; position: absolute; display:none; width: 350px; padding-top:25px; padding-bottom:5px; background-image:url(../List.jpg); height: 210px" >
    <ul style="width: 300px;  overflow:auto; margin-bottom:10px; height: 200px" >
        <li>Berlin</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
        <li>Berlin</li>
        <li>Altrip</li>
    </ul>
    </div>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $("#SelectedCity").click(function (e) {
                e.stopPropagation();
                $("#tree").hide();
                $("#Cities").slideToggle("200");
            });

            $(document).click(function () {
                $("#tree").hide();
                $("#Cities").hide();

            });

            $(".toggle").click(function (e) {
                e.stopPropagation();
                $(this).next("ul").toggle();

            });

            $("#place").click(function (e) {
                e.stopPropagation();
                $("#tree").slideToggle("200");
                $("#Cities").hide();
            });


            $(".city").click(function () {
                $("#place").text($(this).text());
                $("#tree").hide();;
            });
        });
    </script>

    <div id="place"><label>hfosdfosj</label><div>select you place</div></div>
    <ul id="tree">
        <li><div class="toggle">shan dong</div>
            <ul>
                <li class="city">qu fu</li>
                <li class="city">qing dou</li>
            </ul>
           
        </li>
        <li><div class="toggle">he nan</div>
            <ul>
                <li class="city">zheng zhou</li>
                <li class="city">an yang</li>
            </ul>
        </li>
    </ul>


     <%--<div class="Box">--%>
<span class="uparrow"></span><br />
    <div class="dummyText">
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque vitae sapien
 non tortor volutpat fermentum in eu lacus. Cras volutpat luctus nisl id laoreet.
    </div>
    <span class="downarrow"></span>
</div>

    i am content
   

</asp:Content>



CSS file
.dummyText {
    margin: 10px;
    top: 20px;
}
.Box
{
    width: 300px;
    background-color: #666;
    border: 1px solid rgb(102, 102, 102);
    top: 30px;
    left: 10px;
}
.downarrow
{
    /*display: block;*/
    width: 0;
    height: 0;
    /*overflow: hidden;
    float: left;*/
    border: 25px solid transparent;
    border-bottom-width: 10;
    border-top: 25px solid #666;
    /* margin-left: 15px;
    margin-top: 0px; To compensate for box's border */
}
.uparrow
{
    /* display: block;*/
    width: 20px;
    height: 20px;
    /*overflow: hidden;
    float: right;*/
    border: 85px solid red;
    border-top: 5px solid #666;
    border-bottom: 56px solid #bababa;
    /*margin-left: 95px;
    margin-top: -35px;  To compensate for box's border */
 

  /* bottom: 10px;*/
}

Create image slider with Jquery and css


Use of image slider are very common now a days. Almost every site uses it in their home page or in their gallery section. There are thousands of free image sliders available in the web. Most of the time we just pick up a good looking image slider and place it in the site. It really looks good but the problem starts when client wants changes in that slider or he wants to customize it according to his liking. Then we have two options
1. Start looking for a new slider which matches his needs
2. Modify the existing one. But for that we need to understand how that slider is working or its functionality.
In my opinion the second option is lot better. That is why I am giving all the source code (html, css, jquery ) here. See the demo
Do not forget to have jquery-1.3.1.min.js file in your js folder.
Here is the full code
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
< meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
< title>Image Slider</title>
The jquery
< script type=”text/javascript” src=”js/jquery-1.3.1.min.js”></script>
< script type=”text/javascript”>
$(document).ready(function() {
//Execute the slideShow
slideShow();
});
function slideShow(){
//Set the opacity of all images to 0
$(‘#fullgallery a’).css({opacity: 0.0});
//Get the first image and display it (set it to full opacity)
$(‘#fullgallery a:first’).css({opacity: 1.0});
//Set the caption background to semi-transparent
$(‘#fullgallery .caption’).css({opacity: 0.7});
//Resize the width of the caption according to the image width
$(‘#fullgallery .caption’).css({width: $(‘#fullgallery a’).find(‘img’).css(‘width’)});
//Get the caption of the first image from REL attribute and display it
$(‘#fullgallery .content’).html($(‘#fullgallery a:first’).find(‘img’).attr(‘rel’)).animate({opacity: 0.7}, 400);
//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
setInterval(‘myGallery()’,6000);
}
function myGallery(){
//if no IMGs have the show class, grab the first image
var current = ($(‘#fullgallery a.show’)? $(‘#fullgallery a.show’) : $(‘#fullgallery a:first’));
//Get next image, if it reached the end of the slideshow, rotate it back to the first image
var next = ((current.next().length) ? ((current.next().hasClass(‘caption’))? $(‘#fullgallery a:first’) :current.next()) : $(‘#fullgallery a:first’));
//Get next image caption
var caption = next.find(‘img’).attr(‘rel’);
//Set the fade in effect for the next image, show class has higher z-index
next.css({opacity: 0.0})
.addClass(‘show’)
.animate({opacity: 1.0}, 1000);
//Hide the current image
current.animate({opacity: 0.0}, 1000).removeClass(‘show’);
//Set the opacity to 0 and height to 1px
$(‘#fullgallery .caption’).animate({opacity: 0.0}/* { queue:false, duration:0 }).animate({height: ’0px’}, { queue:true, duration:300 }*/) ;
//Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
$(‘#fullgallery .caption’).animate({opacity: 0.7},100 )/*.animate({height: ’100px’},500 )*/;
//Display the content
$(‘#fullgallery .content’).html(caption);
}
</script>
The CSS
< style type=”text/css”>
body{ font-family:Arial, Helvetica, sans-serif}
#fullgallery{
height:360px;
position:relative;
float:left;
}
#fullgallery a{
float:left;
position:absolute;
}
#fullgallery a img {
border:none;
}
#fullgallery a.show {
z-index:1;
}
#fullgallery .caption {
z-index:2;
background-color:#000;
color:#ffffff;
height:100px;
width:100%;
position:absolute;
bottom:0;
}
#fullgallery .caption .content {
margin:5px;
}
#fullgallery .caption .content h3 {
margin:0;
padding:0;
color:#1DCCEF;
}
</style>
< /head>
The Markup
<body>
< div id=”fullgallery”>
<a href=”#” class=”show”>
<img src=”images/mother_nature.jpg” alt=”Mother Nature” width=”580″ height=”360″ title=”" alt=”" rel=”<h3>Mother Nature</h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. “/>
< /a>
< a href=”#”>
<img src=”images/lonely.jpg” alt=”Lonely” width=”580″ height=”360″ title=”" alt=”" rel=”<h3>lonely</h3>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. “/>
< /a>
<a href=”#”>
<img src=”images/sweet_home.jpg” alt=”Sweet Home” width=”580″ height=”360″ title=”" alt=”" rel=”<h3>Sweet Home</h3>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.”/>
< /a>
<a href=”#”>
<img src=”images/never_ending.jpg” alt=”Never Ending” width=”580″ height=”360″ title=”" alt=”" rel=”<h3>Never Ending</h3>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”/>
< /a>
< div class=”caption”><div class=”content”></div></div>
< /div>
< div></div>
< /body>
< /html>
Copy paste the full code in your favorite text editor, see the result and start tweaking as you want .This is a very simple image slider look-wise and functionality-wise but my aim is to understand the simple thing first so that we can build a more complex image slider easily because we know exactly where and how we need to do the changes.

Demo: image slider