Search Results

Search found 2 results on 1 pages for 'smoop'.

Page 1/1 | 1 

  • Jquery .Animate Width Problem.

    - by smoop
    Thanks in advance for any-help with this, I'll try and explain it well. I have a container of 1000px width and 220px height, in this I will have three columns 220px in height but with different widths (77px, 200px and 300px). When you click one div it will open to a fixed size (the same for each, say 400px) and the others which are not clicked will shrink back to their original sizes (77px, 200px and 300px). Like an accordian with different widths.. My jquery is getting there but not quite, I know how to create an Event on click, I know from there I need to shrink everything but the one I clicked back to their orignal size. I finish but making the one clicked expand to the size it needs to be. jsfiddle here! $(document).ready(function(){ // Your code here $('.section').click(function() { $('.section').not(this).animate({width:"77px"},400); //alert('clicked!'); $(this).animate({width:"400px"},400); }); }); <div id="pictureNavContainer"> <div class="section pictureSectionOne" id="1"></div> <div class="section pictureSectionTwo" id="2"></div> <div class="section pictureSectionThree" id="3"></div> </div> <style> #pictureNavContainer{background-color:#262626; width:1000px; height:220px; overflow:hidden;} .pictureSectionOne{float:left; background:yellow; height:220px; width:77px;} .pictureSectionTwo{float:left; background:red; height:220px; width:177px;} .pictureSectionThree{float:left; background:blue; height:220px; width:400px;} </style> I figured a kind of solution: <script> $(document).ready(function(){ // Your code here $('.section').click(function() { $('#1').animate({width:"50px"},400); $('#2').animate({width:"100px"},400); $('#3').animate({width:"200px"},400); //alert('clicked!'); $(this).animate({width:"400px"},400); }); }); </script> But the code isnt very good.. but it works This: $(function(){ var $sections = $('.section'); var orgWidth = []; var animate = function() { var $this = $(this); $sections.not($this).each(function(){ var $section = $(this), org = orgWidth[$section.index()]; $section.animate({ width: org }, 400); }); $this.animate({ width: 400 }, 400); }; $sections.each(function(){ var $this = $(this); orgWidth.push($this.width()); $this.click(animate); }); });

    Read the article

  • Browser Compatablitiy, Support, Modern Browsers and older Versions.

    - by smoop
    This is a question to all web-developers working in the industry more than a few years. Today the server guy at my work told me that his browser didnt render a google font I used on a site properly, so I checked his browser - it was firefox 3.5. (google font Raleway).. This made me think.. I know for some of our sites its a requirement to support IE6 (larger corperate sites) but for the rest (personal sites) should I be looking at developing for all incrments of firefox, chrome, IE and safari???? Does your company still support IE6? Does your company support previous versions of modern browsers or just the latest ones? and finally, has anyone else had this problem with FF 3.5 and Google Hosted font Raleway..(the font displays extra extra thing so the font is almost unreadable) If anyones interested I found a working solution to my font problem here: http://www.jshsolutions.net/google-webfonts-cross-browser-fix-howto/ Sam

    Read the article

1