JavaScript alert box with timer

前端 未结 7 1742
粉色の甜心
粉色の甜心 2020-12-02 17:19

I want to display the alert box but for a certain interval. Is it possible in JavaScript?

7条回答
  •  醉梦人生
    2020-12-02 17:36

    I finished my time alert with a unwanted effect.... Browsers add stuff to windows. My script is an aptated one and I will show after the following text.

    I found a CSS script for popups, which doesn't have unwanted browser stuff. This was written by Prakash:- https://codepen.io/imprakash/pen/GgNMXO. This script I will show after the following text.

    This CSS script above looks professional and is alot more tidy. This button could be a clickable company logo image. By suppressing this button/image from running a function, this means you can run this function from inside javascript or call it with CSS, without it being run by clicking it.

    This popup alert stays inside the window that popped it up. So if you are a multi-tasker you won't have trouble knowing what alert goes with what window.

    The statements above are valid ones.... (Please allow). How these are achieved will be down to experimentation, as my knowledge of CSS is limited at the moment, but I learn fast.

    CSS menus/DHTML use mouseover(valid statement).

    I have a CSS menu script of my own which is adapted from 'Javascript for dummies' that pops up a menu alert. This works, but text size is limited. This hides under the top window banner. This could be set to be timed alert. This isn't great, but I will show this after the following text.

    The Prakash script above I feel could be the answer if you can adapt it.

    Scripts that follow:- My adapted timed window alert, Prakash's CSS popup script, my timed menu alert.

    1.

    
          
                
                
          
    
        
    
    
    

    2.

    
    
    
    

    Popup/Modal Windows without JavaScript

    3.

    
    
    Using DHTML to Create Sliding Menus (From JavaScript For Dummies, 4th Edition)
    
    
    
    
    
    
    
    
    
    ffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdffffdd
    
    
    
    

提交回复
热议问题