SitePoint Sponsor

User Tag List

Results 1 to 23 of 23
  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do you alter the font size in the js alert box's please ?

    Has anyone found a way to alter the size of the text in a javascript alert box please ?

    Any help appreciated.

    Dez.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't something you can do with HTML, which is a markup language for web pages.

    You need to go into the operating system/window manager settings to change this, or, possibly, the browser preferences.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I guess there's no other way of showing it in a larger font ? ? Other than js ?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please read what I posted! You can't do it with JavaScript, either. It's a system setting or a browser setting.
    Birnam wood is come to Dunsinane

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The only alternative is a pseudo-modal box you overlay on the screen, which lays a transparent or semi-opaque "curtain" over everything else. Commonly called a lightbox.

  6. #6
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Please read what I posted! You can't do it with JavaScript, either. It's a system setting or a browser setting.
    Please look carefully at what I posted! Especially the bit where it says "Other than js ?"

  7. #7
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by Raffles View Post
    The only alternative is a pseudo-modal box you overlay on the screen, which lays a transparent or semi-opaque "curtain" over everything else. Commonly called a lightbox.
    Thanks Raffles, the helps appreciated. I'll look at that as well.

  8. #8
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dez View Post
    Please look carefully at what I posted! Especially the bit where it says "Other than js ?"
    You can NOT do it with Javascript. That is what Tommy is saying.

  9. #9
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    You can NOT do it with Javascript. That is what Tommy is saying.
    Yep, got that the FIRST time Ben, that's why I then said "Other than js ?"

    Anyway, no worries

  10. #10
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,601
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dez View Post
    Yep, got that the FIRST time Ben, that's why I then said "Other than js ?"

    Anyway, no worries
    It's just the way you said it that got people confused . Other then JS implies that "other then using javascript is there a way to do this".

    I know that I interpreted it that way, and so did Bpartch and Tommy
    Always looking for web design/development work. Willing to do it cheap to build portfolio!

  11. #11
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    It's just the way you said it that got people confused . Other then JS implies that "other then using javascript is there a way to do this".
    Yep, but I did say it clearly enough. There would be others that understood me as well, but let's move on a little now

  12. #12
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dez View Post
    Yep, but I did say it clearly enough.
    Apparently you didn't as 3 people have now misunderstood it.

  13. #13
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    Apparently you didn't as 3 people have now misunderstood it.
    Apparently, according to pm's, I did. After all, it was "Other than js ?"

  14. #14
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Just about everyone would interpret "other than JS" as implying that there is a way to do it with JavaScript but you are looking for a different solution.

    Raffles provided you with a way to do it using JavaScript but not using an alert().

    Since the alert() is JavaScript there isn't any way to do an alert without JavaScript. There also isn't any way to change the text size in the alert unless you change the font size in the operating system (which only the individual computer owner can do).

    Using JavaScript but not using alert() is therefore the only way of doing this.

    Therefore the answer to "other than JS" is "no there isn't".
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  15. #15
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Just about everyone would interpret "other than JS" as implying that there is a way to do it with JavaScript but you are looking for a different solution.

    <chop>

    Therefore the answer to "other than JS" is "no there isn't".
    Raffles (and others who've pm'd) seemed to understand, that "Thanks. I guess there's no other way of showing it in a larger font ? ? Other than js ?" would mean any other way, apart from js, but anyway, no worries, have moved on from that now. Suggest others here do as well.

  16. #16
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This question doesn't belong in the HTML/XHTML forum at all. Unfortunately the SitePoint moderators don't care any more, but you should still try to post in the appropriate forum.

    In this case you'd need JavaScript to display the faux-alert, but the main issue would be the CSS needed to render it like a message box. So you should ask a moderator to have this thread moved to the CSS forum.
    Birnam wood is come to Dunsinane

  17. #17
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Many thanks for the helpful response Tommy. Now we're in the css forum, hopefully, someone will come in with some ideas on how to do this

  18. #18
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Dez View Post
    Many thanks for the helpful response Tommy. Now we're in the css forum, hopefully, someone will come in with some ideas on how to do this
    Hi,

    Can you explain what you require now that it has been clarified that you can't change the text in an alert box and we'll try to help. Are you just looking for some sort of styled pop up message box?

    Something like the examples on this page perhaps.

  19. #19
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I had a stab at doing this once, trying to do it as CSS-only as possible. It's possible to do it only with CSS (by using the CSS3 pseudo-class) but that's not a cross-browser method.

    For a demonstration go here. The CSS takes advantage of position:fixed and javascript is used only for the event handling and positioning at the right height up the page (and loads of other stuff, but that script was a general use-one, you could just extract the event-handling and positioning bits). It's a bit old and untested with the newer browsers, but it still seems to work and should at least give you a general idea.

  20. #20
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by Paul O'B View Post
    Hi,

    Can you explain what you require now that it has been clarified that you can't change the text in an alert box and we'll try to help. Are you just looking for some sort of styled pop up message box?

    Something like the examples on this page perhaps.
    Thanks Paul, I love the page on that link, excellent work with the rollovers, but what I'm looking for, is a message to tell people in FF to press Ctrl + D if trying to save to favs.

  21. #21
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by Raffles View Post
    I had a stab at doing this once, trying to do it as CSS-only as possible. It's possible to do it only with CSS (by using the CSS3 pseudo-class) but that's not a cross-browser method.

    For a demonstration go here. The CSS takes advantage of position:fixed and javascript is used only for the event handling and positioning at the right height up the page (and loads of other stuff, but that script was a general use-one, you could just extract the event-handling and positioning bits). It's a bit old and untested with the newer browsers, but it still seems to work and should at least give you a general idea.
    Thanks Rafael, as you can see from the post to Paul, it's to tell people in FF to press Ctrl + D if trying to save to favs.

    Bearing the above extra info in mind, is the page on the link you kindly suggested the right way forward for this please ?

  22. #22
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You should have said that in your first post. You see, most Firefox users will have figured out that there are no Favourites and that they are called Bookmarks. If they haven't figured out that to save one they go to Bookmarks > Bookmark this page, then they probably aren't interested in bookmarks/favourites.

    However, if you really want this, I'd go for an approach like on the first link on Paul's page. You'll also have to cater for people who aren't using the mouse.

  23. #23
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raffles View Post
    You should have said that in your first post. You see, most Firefox users will have figured out that there are no Favourites and that they are called Bookmarks. If they haven't figured out that to save one they go to Bookmarks > Bookmark this page, then they probably aren't interested in bookmarks/favourites.

    However, if you really want this, I'd go for an approach like on the first link on Paul's page. You'll also have to cater for people who aren't using the mouse.
    Thanks Rafael, I wasn't aware that it should have been mentioned, and I was just using the word favorites in the same context as bookmarks.

    From experience, I'm all ok with the why's, it's just the how's I need. Anyway, will look closer at Pauls example.


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
  •