Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post

    Open an image in a new window, centered and made to fit the window

    How many times you've been furious about the fact that browsers display your image in the left size, and not properly resized to fit your browsing area ? Well, there's the solution: http://www.windows-addict.com/index.htm?centerimage
    Last edited by oceansoul1976; 12-25-2013 at 07:20 PM.

  2. Users who have thanked oceansoul1976 for this post:

    IvanMilic_1980 (12-27-2013)

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,214
    Thanks
    23
    Thanked 605 Times in 604 Posts
    I would never trust a site that is up for "The Ugliest Site" award. If the author can not center his own site contents why would you promote him? This site is an eye sore and extremely cluttered. His lack of padding makes things hard to read, so I didn't.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    oceansoul1976 (12-26-2013)

  • #3
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post

    @ sunfighter:

    Really ???????? Wow, thank you very much kind sir !!! That makes me proud !! Really ! All good things attract stupid remarks from mediocre people at first !!! And by the way, I don't know what makes you use this kind of language, but I didn't offended your work in any way !
    You said you didn't read anything there ! Than what gives you the right to judge ? Do you think you are better than anyone ? Maybe you are better than me, this I can't deny, but that doesn't make you Torchemada !!! But, since is Christmas, I forgive you and I'll light a candle for you !!!
    Anyway, happy holidays !! And, that award,....I thank you kindly for nominating me !

    P.S.: What gave you the idea that everything must be centered ??????????? Next you'll say that this website is cluttered !!!
    And,for the other users : trust this guy, my website IS ugly !!!! But since it's not the website that we're talking about, but a piece of code that can help others, I think Mr. Sunfighter is pounding around without any reason; No one is promoting anything, it's just a solution you may consider or you may not ! Simple as that !!!!
    Last edited by oceansoul1976; 12-26-2013 at 06:01 PM.

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,214
    Thanks
    23
    Thanked 605 Times in 604 Posts
    Quote Originally Posted by oceansoul1976 View Post
    You said you didn't read anything there ! Than what gives you the right to judge ?
    We all judge. We just don't say anything most of the time. But sometimes we(me) just has to, like, when a fat guy is giving out tips on losing weight. - I didn't judge anything written on your site. I never read anything there, because my eyeballs fell out and bounced around the table. I commented on the site that made me blind. The judgement came from the alphabet soup dragging behind the pointer, the small reoccurring image that was used as a back ground, the lack of padding that made reading a difficult task.

    Quote Originally Posted by oceansoul1976 View Post
    What gave you the idea that everything must be centered ??????????? Next you'll say that this website is cluttered !!!
    Your instructing us on centering our images and telling us how to stop being "furious about the fact that browsers display your image in the left size,(side)" and then you display most things on "the left size,(side)". so yes, I think it should be centered. especially the white box with the code in it - And the code.

    Quote Originally Posted by oceansoul1976 View Post
    And,for the other users : trust this guy, my website IS ugly !!!! But since it's not the website that we're talking about,
    Lets talk about the web site, because your offering advice on how to do things. First No Doctype. Next http://validator.w3.org/check?uri=ht...Inline&group=0 shows 23 Errors, 4 warning(s). You talk about iframes, but use frameset. You put a frameset inside a frameset, not in a good way.

    I have said nothing about your solution to the problem. It might be the best thing out there, but I just can't read it.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #5
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post
    You know what ? It's ok to have your own opinion ! And thanks for sharing it with others ! I say it again, no one forced you to go there ! And as for the centering of the text....really ? So I suppose you read only books that have the text centered ? Wow...that's new..... And the code.... In which forum you've seen the code centered ? Don't say in this one, because then you're really making a fool of yourself !
    P.S..: So to you it's more important how many errors are in a site, or how is structured, rather the fact that the site is functioning properly in any browser ??? One more point to you.
    Anyway, I have to admit that some of your "complaints" are founded, and I must thank you for that ! And... why are you ... antiframeistic ?
    Last edited by oceansoul1976; 12-26-2013 at 11:29 PM.

  • #6
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,969
    Thanks
    56
    Thanked 557 Times in 554 Posts
    apart from the obviously hideous design, is it really necessary to load the entire jQuery library just to put an onload listener on an img tag?

  • #7
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post

    @ xelawho

    Well, to tell you the truth, it was the only way I could make the script to wait for the image to load before continuing
    As I said, I'm new in coding, and I'm actually applying my analist programmer skills to think of ways, but I'm still learning the ropes in HTML and JavaScript.
    If you have some good advice, it is welcomed. And,...can you tell me what is hideous ?
    Thanks
    Last edited by oceansoul1976; 12-26-2013 at 11:28 PM.

  • #8
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,969
    Thanks
    56
    Thanked 557 Times in 554 Posts
    I guess I would add to the list:
    the psychedelic font colors,
    the near-unreadable bold+italic text in the marquee at the top,
    the use of marquee in the first place,
    the fact that while you are providing text that is presumably meant to be copied, it's actually quite difficult to select it,
    the "download it from here" link at the bottom which isn't actually a link

    If you look at really good-looking professional sites you will see that designers employ the "less is more" approach, favoring simplicity over clutter.

    On a general note, the script that you give does not have to be in the head section at all. In fact it shouldn't be, and I would think that you could avoid the use of jQuery simply by doing:

    Code:
    document.getElementById('p1').onload=resize_pic;
    but I haven't tested that.

    Some people also like to test for the availability of window.innerHeight to accommodate IE8 and earlier

    hope that helps!

  • Users who have thanked xelawho for this post:

    oceansoul1976 (12-27-2013)

  • #9
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post

    @ xelawho

    Thanks for your advices, I took some steps in following them.
    As for the document.getElement....onload thing.... it's not working
    The picture is resizing before finishing loading, which, in case of super-slow connection speed (like mine, unfortunately ), has a...0 result

  • #10
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hi

    I am new to this, but I registered just to thank you for the solution. It worked for me, but, as xenodu said: isn't there another way to do this, without loading the js library ?
    About your site, bro, I just took a look at it and, frankly, it's quite nice. A bit too flashy for me, but is alright. It's good to find a not so boring and dull site that follows all the stupid patterns like other web admins transformed in a bunch of crazy sheeps. Do not worry about the bloody trolls that criticize, they're just jealous that it's not their idea.
    And for that a$$***e sunfighter or... whatever fighter, I just want to tell you something: you said you couldn't read anything there; It's your age, mate. It's time for you to buy some glasses.
    Keep up, buddy, and don't let the others take you down. And thanks again.

  • Users who have thanked IvanMilic_1980 for this post:

    oceansoul1976 (12-27-2013)

  • #11
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    1
    Thanked 1 Time in 1 Post
    Sorry, I meant xelawho earlier, not xenodu my bad

  • #12
    New Coder
    Join Date
    Nov 2013
    Location
    UK
    Posts
    42
    Thanks
    6
    Thanked 1 Time in 1 Post
    Thanks IvanMilic 1980. Glad it helped you. And thanks for your words about my site. I'm trying
    And sorry for the use of that javascript, but for now it's the only solution I found to make it wait for the picture to load. If you'll find another way, please, let me know - I'm not too keen on it myself !


  •  

    Posting Permissions

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