Results 1 to 4 of 4

Thread: [RESOLVED] how to use this jquery code?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Resolved [RESOLVED] how to use this jquery code?

    $("#myContentRegion").delegate("img", "hover", function(){
    $(this).animate({
    width: 200, height: 200
    }, 5000, function() {
    $(this).animate({ width: 100, height: 100 });
    });

    });

    found above code on this link: http://stackoverflow.com/questions/3...nerated-images

    how do i use it on my html page? please help.. thanks
    The taller the bamboo grows the lower it bends...

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: how to use this jquery code?

    Hw about this one

    Code:
    
    <html>                                                                  
     <head>                                                                  
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>          
                                                                    
     </head>                                                                 
     <body>                                                                  
        Image over demo  
          <div id="myContentRegion">  
       <img src="http://techreceipe.com/wp-content/uploads/2011/06/InterExpl-Cannot-display-the-page.jpg" height="100" width="100"  alt="Angry face" />   
          </div>
    <script>                                         
       $("#myContentRegion").delegate("img", "hover", function(){
        $(this).animate({ 
                width: 200, height: 200 
            }, 5000, function() {
        $(this).animate({ width: 100, height: 100 });
      });
    
    });
                                      
     </script>
     </body>                                                                 
     </html>
    Demo here
    Last edited by danasegarane; Sep 2nd, 2011 at 06:18 AM. Reason: Demo link
    Please mark you thread resolved using the Thread Tools as shown

  3. #3
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: how to use this jquery code?

    Another Example

    Code:
    
    
    
    <html>                                                                  
     <head>                                                                  
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>          
               
    <script>
     $(document).ready(function(){
           $('#myimage').width(200);
           $('#myimage').mouseover(function()
           {
              $(this).css("cursor","pointer");
              $(this).animate({width: "500px",height:"500px"}, 'slow');
           });
        
        $('#myimage').mouseout(function()
          {   
              $(this).animate({width: "200px",height:"200px"}, 'slow');
           });
       });
                                                         
    </script>
     </head>                                                                 
     <body>                                                                  
        Image over demo  
          <div id="myContentRegion">  
       <img id="myimage" src="http://techreceipe.com/wp-content/uploads/2011/06/InterExpl-Cannot-display-the-page.jpg" height="100" width="100"  alt="Angry face" />   
          </div>
    
    
                                      
     </script>
     </body>                                                                 
     </html>

    Demo here
    Last edited by danasegarane; Sep 2nd, 2011 at 06:14 AM. Reason: Demo
    Please mark you thread resolved using the Thread Tools as shown

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Re: how to use this jquery code?

    hi danasegarane, thank you so much bro for your help
    The taller the bamboo grows the lower it bends...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width