পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Tuesday, March 7, 2017

Materialize - Dialogs

The Materialize provides various special methods to show unobtrusive alerts to the users. Materialize provides a term toast for them. Following is the syntax to show a dialog as toast.
Materialize.toast(message, displayLength, className, completeCallback);
Where

  • message - Message to be displayed to the user.
  • displayLength - duration of the message after which it will disappear.
  • className - style class to be applied to the toast. For example, 'rounded'
  • completeCallback - callback method to be called once toast is dismissed.
For tooltip, Materialize provides following CSS classes.
S.N.Class Name & Description
1tooltipped
Identifies component to have tooltip.
2data-position
Position of the tooltip; bottom, top, left, or right.
3data-delay
Sets the duration of the tooltip after which it will disappear.
4data-tooltip
Set the tooltip contents.

Example

The following example showcases the use of toasts and tooltips.
materialize_dialogs.htm
<html>
   <head>
      <title>The Materialize Dialogs Example</title>
   <meta name="viewport" content="width=device-width, initial-scale=1">      
   <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>           
      <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
      <script>
      function showToast(message, duration){
         Materialize.toast(message, duration);
      }
      function showToast1(message, duration){
         Materialize.toast('<i>'+ message + '</i>', duration);
      }
      function showToast2(message, duration){
         Materialize.toast(message, duration, 'rounded');
      }
      function showToast3(message, duration){
         Materialize.toast('Hello World!', duration, '', function toastCompleted(){
               alert('Toast dismissed!');
            });
      }
      
      </script>
   </head>
   <body class="container"> 
      <h4>Toasts</h4>
      <a class="btn" onclick="showToast('Hello World!', 3000)">Normal Alert!</a>
   <a class="btn" onclick="showToast1('Hello World!', 3000)">Italic Alert!</a>
   <a class="btn" onclick="showToast2('Hello World!', 3000)">Rounded Alert!</a>
   <br/><br/>
   <a class="btn" onclick="showToast3('Hello World!', 3000)">Callback Alert!</a>   
   <h4>Tooltips</h4>
   <a class="btn tooltipped" data-position="bottom" data-delay="50" data-tooltip="I am in bottom!">Bottom</a>
   <a class="btn tooltipped" data-position="left" data-delay="50" data-tooltip="I am in left!">Left</a>
   <a class="btn tooltipped" data-position="right" data-delay="50" data-tooltip="I am in right!">Right</a>
   <a class="btn tooltipped" data-position="top" data-delay="50" data-tooltip="I am in top!">Top</a>
   </body>  
</html>

Result

Verify the result.

No comments:

Post a Comment