Window(s) Modal opening at the same time or at different times

Asked

Viewed 340 times

0

I need to make a system that opens "Modais" while browsing the site, informing some things, windows on the right side at the bottom and other windows on the left side at the bottom, with presentation time.

It is not modal to "freeze" the screen, are informative that appear during navigation....

Someone has an example for this?


Follow the Example,

An image is better than 1000 heheheh words

Look down there "Hay 10 personas targeting this hotel"...

inserir a descrição da imagem aqui

  • Have you seen the toastr?

  • 1

    A good option would be http://introjs.com.

1 answer

0


The Materialize owns the Featurediscovery, is a good resource to guide the user in some system functionalities, follows example of the site:

$('#menu').on('click', function() {
    $('.tap-target').tapTarget('open');
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/css/materialize.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/js/materialize.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<!-- Element Showed -->
<a id="menu" class="waves-effect waves-light btn btn-floating" ><i class="material-icons">menu</i></a>

<!-- Tap Target Structure -->
<div class="tap-target" data-activates="menu">
  <div class="tap-target-content">
    <h5>Title</h5>
    <p>A bunch of text</p>
  </div>
</div>

To enable/disable the display you use:

$('.tap-target').tapTarget('open');    
$('.tap-target').tapTarget('close');

Edit

I saw that the wanted is different of what I answered, can use toast, also from the same framework, follows example:

$(document).on('click', '#toast-container .toast', function() {
    $(this).fadeOut(function(){
        $(this).remove();
    });
});

var content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean iaculis lectus quis feugiat mattis. Maecenas varius orci et magna volutpat, vel vehicula velit imperdiet. Sed accumsan non sapien quis mattis. Nam tristique nunc in ligula venenatis porta. Quisque rhoncus elementum risus nec tincidunt. Curabitur et tempor turpis. Fusce facilisis orci vitae convallis lobortis. Mauris auctor blandit lectus vel pulvinar. Morbi non ipsum pharetra, interdum libero sed, viverra orci. Morbi semper placerat dui vulputate ornare. Aenean quis malesuada leo, sit amet pretium sapien. Aenean tristique interdum velit, tristique consectetur nisl vestibulum ac. Curabitur id tellus rhoncus, tristique libero vel, dignissim mauris. Etiam pellentesque venenatis sagittis. <i class="material-icons prefix right">close</i>';
Materialize.toast(content);
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/css/materialize.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/js/materialize.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

To use just use the command Materialize.toast("Conteúdo", tempo em milissegundos)(time is optional), note that at the end of the content I added <i class="material-icons prefix right">close</i>, this serves only to display the "X" close, works without it.

The code:

$(document).on('click', '#toast-container .toast', function() {
    $(this).fadeOut(function(){
        $(this).remove();
    });
});

Serves to remove screen warning when clicked

  • Very cool this Esture, have more options of it to share?

  • Yes, it helped a lot, but the "Materialize.Oast(content, 50000000000000);"... opening team...

  • @Luccasgaulia In that case you can mark as accepted

  • The team is very high, so for every second, you put 3 zeros in front. Ex: 15 second = 15000. 1 second = 1000 milliseconds

  • Even so, it doesn’t open after 51 seconds...

  • The time is to close automatically

  • To open after a while, you can use the function setTimeout

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.