www.webdeveloper.com
Results 1 to 2 of 2

Thread: jQuery Resize Not Working

  1. #1
    Join Date
    Jan 2003
    Posts
    218

    Question jQuery Resize Not Working

    This works fine:

    Code:
    jQuery(document).ready(function () {
    	var highestCol = Math.max(jQuery('#home-feature-1').height(),jQuery('#home-feature-2').height(),jQuery('#home-feature-3').height());
    	jQuery('.content-box.big').height(highestCol);
    });
    But I can't get the resize to work:

    Code:
    jQuery(window).resize(function() {
    	var highestCol = Math.max(jQuery('#home-feature-1').height(),jQuery('#home-feature-2').height(),jQuery('#home-feature-3').height());
    	jQuery('.content-box.big').height(highestCol);
    });
    I've tried including the resize function inside the document.ready and out. Any ideas?

    Thank you for your help.

  2. #2
    Join Date
    Sep 2007
    Location
    istanbul
    Posts
    315
    http://www.w3schools.com/Jquery/tryi...y_event_resize
    Code:
      
    <!DOCTYPE html>
    <html>
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
    var x=0;
    $(document).ready(function(){
      $(window).resize(function(){
        $("span").text(x+=1);
      });
    });
    </script>
    </head>
    <body>
    
    <p>Window resized <span>0</span> times.</p>
    <p>Try resizing your browser window.</p>
    
    </body>
    </html>
    http://www.w3schools.com/Jquery/event_resize.asp
    Last edited by Ayşe; 06-17-2014 at 07:11 PM.
    Bismillahirrahmanirrahîm
    Hamd, Âlemlerin Rabbi, Rahmân, Rahîm, hesap ve ceza gününün (ahiret gününün) maliki Allah'a mahsustur. (Allahım!) Yalnız sana ibadet ederiz ve yalnız senden yardım dileriz. Bizi doğru yola, kendilerine nimet verdiklerinin yoluna ilet; gazaba uğrayanların ve sapıklarınkine değil.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles