Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Width/Height Displaying Weird

  1. #1
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default Width/Height Displaying Weird

    So i updated my page but i am having a weird problem in http://cgs.thebcelements.com/

    First i have an id
    Code:
    #gallery1 { border:1px solid black; height:250px; width:300px; background-color:black;}
    When i use jquery to get the width and/or height it displays at as w:1333 and h:0. (It is show at the bottom). I do not know why that is happening. Any ideas would be great.
    Last edited by Deadweight; 09-12-2014 at 04:11 PM.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Update. If you click on the link (EG HOME) again and reload the page it works. I dont know why....
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Your comment declarations are incorrect. Remove the commented lines and see what happens.

  4. #4
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Comments are fine. It how i load in my js and css. I can delete all code but the box itself and it still says the width of the page. Somehow i need to delay this:
    Code:
    $(function(){
    	
    	create_slide_gallery({
    		id:'gallery1',
    		images: ['images/physical/adapters.jpg','images/physical/ethernetcable.jpg','images/physical/keyboard.jpg','images/physical/mouse.gif'],
    		info: ['Adapter','Ethernet Cable','Keyboards','Mouse'],
    		first: 0,
    		arrows: ['images/back.png','images/forward.png'] // Left, Right (for images use the html code)
    	})
    	
    })
    I think i need to change it from $(function(){}) to something else
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    The WC3 Validation Service gives 11 html errors, among which invalid comment declaration: found character "<" outside comment but inside comment declaration. So that may spoil things.
    If the errors are not the source of the problem, you might try to put your scripts immediately before the closing body tag. The reason I think this might help is that the problem disappears after a page refresh.

  6. #6
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Yeah but i dont want to do that xD its soooo ugly xD
    So i am trying to think of another way to delay the function from happening
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  7. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Did you try to move the functions to the end of the body section?
    You could also try defer.

  8. #8
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Your problem is caused by incorrect comment declarations, as I already mentioned. This works for me, and it validates too:
    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=utf-8" />
    <title>Bits &amp; Bytes</title>
    
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/jquery.js"></script>
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/headappend.js"></script>
    
    <link href="http://cgs.thebcelements.com/css/main.css" rel="stylesheet"/>
    <link href="http://cgs.thebcelements.com/css/slide.css" rel="stylesheet"/>
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/navbar.js"></script>
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/timebar.js"></script>
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/imgslider.js"></script>
    <script type="text/javascript" src="http://cgs.thebcelements.com/js/slide.js"></script>
    
    </head>
    <body>
    
    <!-- Creates the Nav bar with jquery/js -->
    <div id="nav_main"></div>
    
    <div id="header_data" class="outer_body">
    <div class="top">Bits &amp; Bytes</div>
    <img src="http://cgs.thebcelements.com/images/background.jpg" alt="bla" class="wait"  />
    <div class="bottom" id="DateAndTime"></div>
    </div>
    
    <div class="outer_body" id="index_info">
    <div id="miniabout">
    <strong>Bits &amp; Bytes</strong> has been around for since 1980. We have the best customer service for many years! If you are not happy then we will not be happy! Bits &amp; Bytes offers excellent pricing for Windows and Mac computers. We will also repair your computer or install your software for you.
    </div>
    
    <div id="gallery2"></div>
        	
    </div>
    <div id="gallery1"></div>
    </body>
    </html>

  9. #9
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    I deleted all the comments. Same thing occurs. Like i said. The css file isnt being read before the JavaScript file collects the data.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  10. #10
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Umm i think this is incorrect but to make it work i had to do something like this:
    Code:
    $(function(){
    	create_slide_gallery({
    		id:'gallery1',
    		images: ['images/physical/adapters.jpg','images/physical/ethernetcable.jpg','images/physical/keyboard.jpg','images/physical/mouse.gif'],
    		info: ['Adapter','Ethernet Cable','Keyboards','Mouse'],
    		first: 0,
    		arrows: ['images/back.png','images/forward.png'] // Left, Right (for images use the html code)
    	})
    })
    
    $(window).load(function() {
    	create_slide_gallery({
    		id:'gallery1',
    		images: ['images/physical/adapters.jpg','images/physical/ethernetcable.jpg','images/physical/keyboard.jpg','images/physical/mouse.gif'],
    		info: ['Adapter','Ethernet Cable','Keyboards','Mouse'],
    		first: 0,
    		arrows: ['images/back.png','images/forward.png'] // Left, Right (for images use the html code)
    	})	
    })
    However, it only works chrome and firefox. Not IE (unless i refresh the page)
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. width and height
    By EXCUSE in forum HTML
    Replies: 1
    Last Post: 11-17-2008, 05:29 PM
  2. Table width and height in IE and FF
    By chas in forum HTML
    Replies: 4
    Last Post: 07-24-2008, 12:35 PM
  3. Percentage Height and Width
    By hurry in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 01-28-2008, 06:25 AM
  4. Replies: 6
    Last Post: 02-20-2007, 02:51 PM
  5. inline css height/width
    By neilkw in forum CSS
    Replies: 0
    Last Post: 07-04-2006, 12:15 PM

Bookmarks

Posting Permissions

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