Skip to main content

How to use bootstrap plugin?

BOOTSTRAP EXTEND IN USING CUSTOM PLUGIN


Bootbox.js: Bootbox.js is a small JavaScript library that allows creating dialog boxes programmatically using the Bootstrap modal, without having to worry about creating, managing, or removing any required DOM elements or JS event handlers.

Example:


<!-set up the modal to start hidden and fade in and out ->

<div id="myModal" class="modal hide fade">

<!-- dialog contents -->

 <div class="modal-body">Hello world!</div>

<!-- dialog buttons -->

<div class="modal-footer">

<a href="#" class="btn primary">OK</a></div>

 </div>

 <!-- sometime later, probably inside your on load event callback -->

<script> 

$("#myModal").on("show" function() { // wire up the OK button to dismiss the modal when shown

$("#myModal a.btn").on("click", function(e){ consolelog ("button pressed"); // just as an example...

$("#myModal").modal ( "hide^ prime ); // dismiss the dialog

});

});

$("#myModal").on("hide", function() {//remove the event listeners when the dialog is dismissed 

$("#myModal a.btn").off("click"); });

 $("#my Modal") on("hidden". function() { // remove the actual elements from the DOM when fully hidden

$("#myModal").remove();

});

$("#myModal").modal({ // wire up the actual modal functionality and show the dialog

"backdrop": "static", 

"keyboard": true,

"show" true // ensure the modal is shown immediately

}); </script>

Scrollspy.js:

Scrollspy plug-in is used to automatically update navigation list links based on scroll position.


data-* attribute medium


Add the data-spy="scroll" attribute to the element in which the scrollspy will be used (most often in the <body> element). Then add the data-target attribute to the id value or the navigation bar (.navbar) class. Name must be added. It creates the scroll area connection with the navbar. The ID of the navbar's list item must be the same as the ID of the scroll area (<div id="section 1"> and <a href="#section 1").

When schooling, the optional data-offset attribute specifies how many pixels down from the top during schooling. This option is very important when it seems that the navbar's active state is changing too fast or too slow relative to the scroll element. Default value is 10 pixels.


Affix.js:

Plug-ins are used to fix an element to a specific location on the page. This is often navigation. Used for menu and social icons, so that they are fixed to a specific location on the page during page scrolling.

This plugin toggles the element's behavior based on the trueling position (Position is static in CSS). The Affix plugin basically toggles between three classes: affix, affix-top, and affix-bottom. Each class represents a specific state. You must use the position:fixed CSS property in the affix class to handle the actual position yourself.

Data-" attribute means: Add data-spy="afflix" attribute to the element to which you want to add affix and data-offset-top|bottom="number" attribute to specify the scroll position.

Example:


<!DOCTYPE html>

<html>

<head>

<title>Bootstrap Affix Example</title>

<meta charset="utf" >
<meta name="viewport"content="width=device-width, initial-scale=1">

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 

<style>

affix{

top: 0;

width: 100%;

}

.affix + .container-fluid ( padding-top: 70px;

}

</style>

</head>

<body>

<div class="container-fluid" style="background-colour:#F44336; colour:#fff;height: 200px;"> 

<h1> Bootstrap Affix Example </h1>

<h3> Scrolling fixed (sticky) navbar </h3>

<p>data-spy="affix" results in page scrolling to see what the navbar looks like. </p>

<p><strong> The navbar will freeze on the page after scrolling a certain number of pixels. </strong></p>

</div>

<nav class="navbar navbar-inverse" data-spy="affix" data-offset-top="197" style="border-radius:0">

<ul class="nav navbar-nav">

<li class="active"><a href="#">Home page</a></li>

 <li><a href="#">Service page</a></li>

<li><a href="#">Contract page</a></li>

</ul>

</nav>

<div class="container-fluid" style="height:1000px">

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1> <h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1> <h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

<h1>This is some normal text.</h1>

</div>

</body>

</html>


 

 

 

Comments

Popular posts from this blog

Unlocking Online Success: Why Justoctane SEO Services are the Best Choice for Businesses in Boca Raton, Florida.

Best Justoctane SEO Services Boca Raton in Florida Are you looking for the best SEO services in Boca Raton, Florida? Look no further than Justoctane SEO services. As a leading provider of SEO services, Justoctane has helped numerous businesses in the Boca Raton area achieve top rankings on search engine results pages. In this blog post, we will explore why Justoctane is the best choice for SEO services in Boca Raton. Experience and Expertise Justoctane has a team of experienced and highly skilled SEO professionals who have a deep understanding of search engine algorithms and the latest SEO techniques. Their expertise allows them to create customized SEO strategies that are tailored to the specific needs of each client. The Justoctane team has worked with businesses in various industries and niches, providing them with a wealth of knowledge and experience to draw from when creating effective SEO strategies. Comprehensive Services Justoctane offers a wide range of SEO services, incl

What is cryptocurrency? How Bitcoin Works ?

What is cryptocurrency? Cryptocurrency is a type of cryptocurrency; Which has no real form. It only exists in the internet world; Transactions using it are only possible online not offline. Whose entire activities are carried out in a secure process called cryptography; It is software based only, you can't touch even if you want to. Some shopping sites now offer cryptocurrency transactions. You can buy things from those sites using cryptocurrency. It is hoped that in the near future cryptocurrency will be used everywhere. How many types of cryptocurrencies are there? There are currently about 17,499+ types of cryptocurrencies on the market according to coinmarketcap.com . The most popular of these are: Bitcoin, Etherium, Lightcoin, etc .; Bitcoin is the world's first successful cryptocurrency. We will first calculate the total value of Bitcoin because it is simple. As of February 11, 2022, the value of all bitcoins in the world was  $851,455,626,804 USD , according to CoinMarke

কম্পিউটার আর্কিটেকচার কি? কম্পিউটার আর্কিটেকচার কয় প্রকার ও কী কী?

কম্পিউটার আর্কিটেকচার (Computer Architecture) কম্পিউটার ইঞ্জিনিয়ারিং-এ কম্পিউটার আর্কিটেকচার হচ্ছে কম্পিউটার সিস্টেমের কনসেপচুয়াল নকশা এবং কম্পিউটারের বেসিক অপারেশনের গঠন বিন্যাস। কম্পিউটার সিস্টেমে যে-সব বৈশিষ্ট্য প্রোগ্রামারের কাছে দৃশ্যমান অথবা প্রোগ্রামের লজিক্যাল এক্সিকিউশনের উপর যে-সব বৈশিষ্ট্যের সরাসরি প্রভাব আছে, তাকে কম্পিউটার আর্কিটেকচার বলে। উদাহরণস্বরূপ বলা যায় আর্কিটেকচারাল বৈশিষ্ট্যের মধ্যে আছে ইনস্ট্রাকশন সেট, বিভিন্ন ডাটাটাইপ রিপ্রেজেন্ট করতে ব্যবহৃত বিটের সংখ্যা, ইনপুট আউটপুট মেকানিজম এবং মেমরি অ্যাড্রেসিং-এর জন্য বিভিন্ন পদ্ধতি । কম্পিউটার আর্কিটেকচারের দুটি ধারা প্রচলিত আছে। একটি হলো হার্ভার্ড আর্কিটেকচার ও অপরটি ভন নিউম্যান বা প্রিন্সটন আর্কিটেকচার। আধুনিক কম্পিউটার আর্কিটেকচার (Modern Computer Architecture) আধুনিক কম্পিউটারের মৌলিক আর্কিটেকচার । হার্ভার্ড আর্কিটেকচার দ্বিতীয় বিশ্বযুদ্ধ চলাকালে হার্ভার্ড বিশ্ববিদ্যালয়ে এই আর্কিটেকচার নিয়ে গবেষণা করা হয়। হাওয়ার্ড আইকেন প্রথম এই আর্কিটেকচার প্রস্তাব করেন। দূরপাল্লার ক্ষেপণাস্ত্র নিয়ন্ত্রণে এই আর্কিটেকচার