Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How to display an alert with a scroll bar

  1. #1
    tarek.mostafa is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    How to display an alert with a scroll bar

    Dear all,

    How to display an alert message with a scroll bar attached?!!.

    If this is not applicable, then how to display a popup message with a scroll bar, which acts completely as an alert message in its behaviour, meaning that the user can not act on the page except when he confirms the alert?!!

    Thanks in advance

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: How to display an alert with a scroll bar

    Why does it need a scrollbar?

    You will probably need to create a <div> element that hovers in front of the rest of the content.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: How to display an alert with a scroll bar

    You can't make an "alert" but you can kinda make your own, like WP said, make a div, add some properties like height and width set the "scroll:auto" in there. Position it in the middle of the screen and black everything else out.

  5. #4
    tarek.mostafa is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Re: How to display an alert with a scroll bar

    I need a scrollbar, because i concatenate some strings in my alert message and sometimes the alert doesnot display the whole message.

    It seems that to create my own is the only solution available. But how can i black everything else?!

    Thank u both for your help, i really appreciate it.

  6. #5
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: How to display an alert with a scroll bar

    Code:
    var overlay=document.createElement('div');
    overlay.setAttribute('style',"background-color:black;display:block;vertical-align:middle;position:absolute;top:0px;left:0px;background-color: black;opacity:1;height:"+ window.innerHeight +"px;width:"+window.innerWidth + "px;");
    overlay.appendChild(document.createTextNode('replace this element with your alert box/div'));
    document.body.appendChild(overlay);
    this can help you but im not sure if it will work in ie. but its working in opera and firefox
    replace the textnode in "overlay.appendChild(document.createTextNode('repl ace this element with your alert box/div'));" with your alert div.
    sorry for the crappy code i had to rewrite it from my mootools class, if you have mootools 1.2 core loaded in your pages i can post the JS class for it
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  7. #6
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: How to display an alert with a scroll bar

    Does opacity work in the browsers amr? I thought that only worked in some versions of IE?

    If not, try making a PNG image with partical transparency, that isn't totally supported by less than IE6, but it looks cool and that's how facebook does it.

  8. #7
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: How to display an alert with a scroll bar

    yeah opacity works fine on all browsers
    i checked opacity with firefox 3+ opera 9+ and even ie7
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  9. #8
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: How to display an alert with a scroll bar

    Does IE6? Even if probably wont matter lol that's the one that does not support PNG transparency, so it's matched up so far and if it can do that it's better. Also because it's CSS compared to an image it's less loading time too. So it wins

  10. #9
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: How to display an alert with a scroll bar

    yeah pngs in ie6 made me hate my life.
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  11. #10
    tarek.mostafa is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Re: How to display an alert with a scroll bar

    hey amrosama,

    I will try this out and let you know.

    Thanks for your help, i really appreciate it

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Windows How to keep auto scroll on top when switching screens
    By fortydub in forum Mobile Development
    Replies: 0
    Last Post: 10-11-2011, 03:30 AM
  2. Scroll Bars
    By Root23 in forum JavaScript and CSS
    Replies: 0
    Last Post: 05-30-2011, 11:01 PM
  3. Scroll Bar
    By JakeWindu in forum C# Programming
    Replies: 3
    Last Post: 02-03-2010, 05:00 AM
  4. How to scroll the screen in openGL
    By Daskill in forum C and C++
    Replies: 5
    Last Post: 03-24-2009, 01:50 PM
  5. issue with scroll sync
    By jiggsroger in forum C# Programming
    Replies: 3
    Last Post: 04-09-2008, 10:07 AM

Tags for this Thread

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