<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML5 &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/html5/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Tue, 10 Jul 2018 11:49:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>HTML5 &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Programmatically Change The Element Or Page Into Full Screen Mode</title>
		<link>https://www.sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/</link>
					<comments>https://www.sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 07 Mar 2016 00:00:49 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Client Side API]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Page Into Full Screen Mode]]></category>
		<category><![CDATA[requestFullscreen]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11332</guid>

					<description><![CDATA[In this article we are going to see how we can change any element or any page into full screen mode programmatically. To do this requirement we are going to use client side API requestFullscreen . To make it compatible to all the browsers, we will be using separate API calls for each browsers. By using requestFullscreen , you can easily make the items to be viewable in a full screen mode. That&#8217;s cool right? You can use Video&#8217;s, Audio&#8217;s, Images, Pages or anything. Now shall we go and see this in detail? I hope you will like this. Download [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we are going to see how we can change any element or any page into full screen mode programmatically. To do this requirement we are going to use client side API <em>requestFullscreen </em>. To make it compatible to all the browsers, we will be using separate API calls for each browsers. By using <em>requestFullscreen </em>, you can easily make the items to be viewable in a full screen mode. That&#8217;s cool right? You can use Video&#8217;s, Audio&#8217;s, Images, Pages or anything. Now shall we go and see this in detail? I hope you will like this.</p>
<p><strong>Download the source code</strong></p>
<p>You can always download the source code here: 	</p>
<li><a href="http://sibeeshpassion.com/Download/Programmatically_Change_The_Element_Or_Page_Into_Full_Screen_Mode.rar" target="_blank">Programmatically Change The Element Or Page Into Full Screen Mode</a></li>
<p><strong>Background</strong></p>
<p>Yesterday I have got a requirement to do the full screen option programmatically in one of my application, I was required to open a chart, which is already being loaded to a page, in full screen mode. I have done that with the help of full screen API. Here I am going to show you that. Now we will start our coding. I hope you will enjoy reading. </p>
<p><strong>Create an Empty Website in Visual Studio</strong></p>
<p>Click File-> New-> Web Site.  </p>
<div id="attachment_11325" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11325" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png" alt="Empty Website In Visual Studio" width="650" height="449" class="size-full wp-image-11325" srcset="/wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500.png 650w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-300x207.png 300w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-160x110.png 160w, /wp-content/uploads/2016/03/Empty-Website-In-Visual-Studio-e1456922541500-400x276.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11325" class="wp-caption-text">Empty Website In Visual Studio</p></div>
<p><strong>Create a new HTML page</strong></p>
<p>Now create a new page, start coding.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Programmatically Change The Element Or Page Into Full Screen Mode&lt;/title&gt;<br />
    &lt;meta charset=&quot;utf-8&quot; /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Using The Code</strong></p>
<p>We will be using pure JavaScript code to do this requirement. Firs of all create the container element and one other element in which we can fire the full screen function in on click event. </p>
<p>[html]<br />
  &lt;div id=&quot;container&quot; align=&quot;center&quot;&gt;&lt;/div&gt;<br />
    &lt;img src=&quot;full_screen.png&quot; onclick=&quot;changeToFullScreen()&quot; title=&quot;Click to change to full screen&quot;/&gt;<br />
[/html]</p>
<p>Here <em>changeToFullScreen()</em> is the function which does the task.</p>
<p>[js]<br />
 &lt;script&gt;<br />
        function changeToFullScreen() {<br />
            var itm = document.getElementById(&quot;container&quot;);<br />
            if (itm.requestFullscreen) {<br />
                itm.requestFullscreen();<br />
            } else if (itm.msRequestFullscreen) {<br />
                itm.msRequestFullscreen();<br />
            } else if (itm.mozRequestFullScreen) {<br />
                itm.mozRequestFullScreen();<br />
            } else if (itm.webkitRequestFullscreen) {<br />
                itm.webkitRequestFullscreen();<br />
            }<br />
        }<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Now if you run your page in Google Chrome and fire the function, you will be given an output as preceding. </p>
<div id="attachment_11333" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png"><img decoding="async" aria-describedby="caption-attachment-11333" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png" alt="Chnage_Element_To_Full_Screen_In_Google_Chrome_Error" width="650" height="487" class="size-full wp-image-11333" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909.png 650w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909-300x225.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome_Error-e1456985687909-400x300.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11333" class="wp-caption-text">Chnage_Element_To_Full_Screen_In_Google_Chrome_Error</p></div>
<p>As you can see that the window is opened in full screen, but not the element. To fix this, you must add a custom CSS style as follows. This is a hot fix which is applicable only to Google Chrome.</p>
<p>[css]<br />
#container:-webkit-full-screen {<br />
            width: 100%;<br />
            height: 100%;<br />
        }<br />
[/css]</p>
<p>Now run your page again, and make sure the fix is applied. </p>
<div id="attachment_11334" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png"><img decoding="async" aria-describedby="caption-attachment-11334" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png" alt="Chnage_Element_To_Full_Screen_In_Google_Chrome" width="650" height="588" class="size-full wp-image-11334" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761.png 650w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761-300x271.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_In_Google_Chrome-e1456987149761-400x362.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11334" class="wp-caption-text">Chnage_Element_To_Full_Screen_In_Google_Chrome</p></div>
<p>Now if you want to escape from full screen whenever user press any keys, you can do that too. You can add a new function as follows.</p>
<p>[js]<br />
function changeToFullScreenOnKeyPress() {<br />
            if (!document.fullscreenElement &amp;&amp; !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement &amp;&amp; !document.msFullscreenElement) {<br />
                if (document.documentElement.requestFullscreen) {<br />
                    document.documentElement.requestFullscreen();<br />
                } else if (document.documentElement.msRequestFullscreen) {<br />
                    document.documentElement.msRequestFullscreen();<br />
                } else if (document.documentElement.mozRequestFullScreen) {<br />
                    document.documentElement.mozRequestFullScreen();<br />
                } else if (document.documentElement.webkitRequestFullscreen) {<br />
                    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);<br />
                }<br />
            } else {<br />
                if (document.exitFullscreen) {<br />
                    document.exitFullscreen();<br />
                } else if (document.msExitFullscreen) {<br />
                    document.msExitFullscreen();<br />
                } else if (document.mozCancelFullScreen) {<br />
                    document.mozCancelFullScreen();<br />
                } else if (document.webkitExitFullscreen) {<br />
                    document.webkitExitFullscreen();<br />
                }<br />
            }<br />
        }<br />
[/js]</p>
<p>And you can call this function in <em>keydown</em> event as preceding.</p>
<p>[js]<br />
document.addEventListener(&quot;keydown&quot;, function (e) {<br />
            changeToFullScreenOnKeyPress();<br />
        }, false);<br />
[/js]</p>
<p>Run your page again and notice that the full screen is getting escaped whenever you press any keys. </p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Programmatically Change The Element Or Page Into Full Screen Mode&lt;/title&gt;<br />
    &lt;meta charset=&quot;utf-8&quot; /&gt;<br />
    &lt;script&gt;<br />
        function changeToFullScreen() {<br />
            var itm = document.getElementById(&quot;container&quot;);<br />
            if (itm.requestFullscreen) {<br />
                itm.requestFullscreen();<br />
            } else if (itm.msRequestFullscreen) {<br />
                itm.msRequestFullscreen();<br />
            } else if (itm.mozRequestFullScreen) {<br />
                itm.mozRequestFullScreen();<br />
            } else if (itm.webkitRequestFullscreen) {<br />
                itm.webkitRequestFullscreen();<br />
            }<br />
        }<br />
        function changeToFullScreenOnKeyPress() {<br />
            if (!document.fullscreenElement &amp;&amp; !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement &amp;&amp; !document.msFullscreenElement) {<br />
                if (document.documentElement.requestFullscreen) {<br />
                    document.documentElement.requestFullscreen();<br />
                } else if (document.documentElement.msRequestFullscreen) {<br />
                    document.documentElement.msRequestFullscreen();<br />
                } else if (document.documentElement.mozRequestFullScreen) {<br />
                    document.documentElement.mozRequestFullScreen();<br />
                } else if (document.documentElement.webkitRequestFullscreen) {<br />
                    document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);<br />
                }<br />
            } else {<br />
                if (document.exitFullscreen) {<br />
                    document.exitFullscreen();<br />
                } else if (document.msExitFullscreen) {<br />
                    document.msExitFullscreen();<br />
                } else if (document.mozCancelFullScreen) {<br />
                    document.mozCancelFullScreen();<br />
                } else if (document.webkitExitFullscreen) {<br />
                    document.webkitExitFullscreen();<br />
                }<br />
            }<br />
        }<br />
        document.addEventListener(&quot;keydown&quot;, function (e) {<br />
            changeToFullScreenOnKeyPress();<br />
        }, false);<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        #container:-webkit-full-screen {<br />
            width: 100%;<br />
            height: 100%;<br />
        }<br />
        #container<br />
        {<br />
            width:72px;<br />
            height:148px;<br />
            background-image:url(&#8216;sibeeshpassionLogoSmall.png&#8217;);<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div id=&quot;container&quot; align=&quot;center&quot;&gt;&lt;/div&gt;<br />
    &lt;img src=&quot;full_screen.png&quot; onclick=&quot;changeToFullScreen()&quot; title=&quot;Click to change to full screen&quot;/&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<blockquote><p> Here <em>msRequestFullscreen</em>, <em>mozRequestFullScreen</em>, <em>webkitRequestFullscreen</em> is for Internet Explorer, Mozilla Firefox, Google Chrome respectively.</p></blockquote>
<p>We have done everything needed, Now it is time to see the output.</p>
<p><strong>Output</strong></p>
<div id="attachment_11335" style="width: 246px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Click.png"><img decoding="async" aria-describedby="caption-attachment-11335" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Click.png" alt="Chnage_Element_To_Full_Screen_Click" width="236" height="255" class="size-full wp-image-11335" /></a><p id="caption-attachment-11335" class="wp-caption-text">Chnage_Element_To_Full_Screen_Click</p></div>
<div id="attachment_11336" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output.png"><img decoding="async" aria-describedby="caption-attachment-11336" src="http://sibeeshpassion.com/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1024x575.png" alt="Chnage_Element_To_Full_Screen_Output" width="634" height="356" class="size-large wp-image-11336" srcset="/wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1024x575.png 1024w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-300x169.png 300w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-768x431.png 768w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-400x225.png 400w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output-1068x600.png 1068w, /wp-content/uploads/2016/03/Chnage_Element_To_Full_Screen_Output.png 1362w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11336" class="wp-caption-text">Chnage_Element_To_Full_Screen_Output</p></div>
<p>Have a happy coding.</p>
<p><strong>References</strong></p>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API" target="_blank">Fullscreen_API</a></li>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/programmatically-change-the-element-or-page-into-full-screen-mode/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom Pager Using prev and next In jQuery</title>
		<link>https://www.sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/</link>
					<comments>https://www.sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 10:44:24 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Custom Pager]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Next jQuery]]></category>
		<category><![CDATA[Prev jQuery]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10829</guid>

					<description><![CDATA[In this post we will create a custom pager using prev and next functions in jQuery. You can treat this post as a simple demo of using prev and next functions. We will be using some html UI elements and we will apply the paging functionality by using native jQuery codes. In this way you can get the information about on which page is requested by the user, once you get it, you can create an jQuery ajax call and fetch the data from the database and show. You need to know the basic of jQuery and CSS before going [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will create a custom pager using <em>prev </em>and <em>next </em> functions in <a href="http://sibeeshpassion.com/category/jquery" target="_blank">jQuery</a>. You can treat this post as a simple demo of using <em>prev </em>and <em>next </em> functions. We will be using some html UI elements and we will apply the paging functionality by using native jQuery codes. In this way you can get the information about on which page is requested by the user, once you get it, you can create an jQuery ajax call and fetch the data from the database and show. You need to know the basic of jQuery and CSS before going further. I hope you will like this.</p>
<p><strong>Background</strong></p>
<p>We can find so many pager in on-line. Here in this post I am just trying to populate my own pager. Please be noted that this is just a demo, so that you can not find more functionalities here. </p>
<p><strong>Using the code</strong></p>
<p>First thing you need to do is create a page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Prev Next In jQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
   &lt;div id=&quot;container&quot;&gt;<br />
        &lt;div id=&quot;outer&quot;&gt;<br />
            &lt;div&gt;-6&lt;/div&gt;<br />
            &lt;div&gt;-5&lt;/div&gt;<br />
            &lt;div&gt;-4&lt;/div&gt;<br />
            &lt;div&gt;-3&lt;/div&gt;<br />
            &lt;div&gt;-2&lt;/div&gt;<br />
            &lt;div&gt;-1&lt;/div&gt;<br />
            &lt;div class=&quot;first&quot;&gt;0&lt;/div&gt;<br />
            &lt;div&gt;1&lt;/div&gt;<br />
            &lt;div&gt;2&lt;/div&gt;<br />
            &lt;div&gt;3&lt;/div&gt;<br />
            &lt;div&gt;4&lt;/div&gt;<br />
            &lt;div&gt;5&lt;/div&gt;<br />
            &lt;div&gt;6&lt;/div&gt;<br />
            &lt;div&gt;7&lt;/div&gt;<br />
        &lt;/div&gt;<br />
        &lt;div&gt;<br />
            &lt;table&gt;<br />
                &lt;tr&gt;<br />
                    &lt;td class=&quot;prev&quot; title=&quot;Previous&quot;&gt;&lt;&lt;&lt;&lt;/td&gt;<br />
                    &lt;td class=&quot;next&quot; title=&quot;Next&quot;&gt;&gt;&gt;&gt;&lt;/td&gt;<br />
                &lt;/tr&gt;<br />
            &lt;/table&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then we will apply some CSS, so that it will look nice. </p>
<p>[css]<br />
 &lt;style&gt;<br />
        #outer div {<br />
            width: 20px;<br />
            height: 20px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
            float: left;<br />
            background: green;<br />
        }</p>
<p>        #outer .first {<br />
            background: blue;<br />
        }</p>
<p>        .prev, .next {<br />
            font-weight: bold;<br />
            font-size:30px;<br />
            padding:10px;<br />
            cursor:pointer;<br />
        }</p>
<p>        #container {<br />
            text-align: center;<br />
            width: 50%;<br />
            margin-left: 25%;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now add jQuery reference.</p>
<p>[js]<br />
&lt;script&gt;<br />
 &lt;script src=&quot;JQuery%20Versions/jquery-1.11.3.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Run your page and make sure that our custom pager design is fine.</p>
<div id="attachment_10830" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png"><img decoding="async" aria-describedby="caption-attachment-10830" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png" alt="Custom Pager Using prev and next In jQuery" width="650" height="103" class="size-full wp-image-10830" srcset="/wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334.png 650w, /wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334-300x48.png 300w, /wp-content/uploads/2015/10/Custom_Pager_Using_prev_and_next_In_jQuery-e1445423340334-400x63.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10830" class="wp-caption-text">Custom Pager Using prev and next In jQuery</p></div>
<p>Now it is time to add our scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            var $first = $(&quot;.first&quot;);<br />
            var i = 0;<br />
            $(&quot;.prev&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.prev();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
            $(&quot;.next&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.next();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>If you notice in the code block, you can see that we are checking<em> $(&#8216;#outer div&#8217;).length / 2 < i</em> in each click. This will get true when the user clicked after the selection goes to end. We are just making the iteration to first when this occurs. </p>
<p>We are doing the above mentioned scenario both in prev click and next click. Now it is time for demo right?</p>
<p>Please see the demo here: <a href="http://sibeeshpassion.com/demo/custompager/" target="_blank">Custom Pager</a></p>
<p>That is all. We did it.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Prev Next In jQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            var $first = $(&quot;.first&quot;);<br />
            var i = 0;<br />
            $(&quot;.prev&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.prev();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
            $(&quot;.next&quot;).click(function () {<br />
                ++i;<br />
                if ($(&#8216;#outer div&#8217;).length / 2 &lt; i) {<br />
                    i = 0;<br />
                    $(&#8216;#outer .first&#8217;).css(&#8216;background&#8217;, &#8216;blue&#8217;);<br />
                    $first = $(&quot;.first&quot;);<br />
                } else {<br />
                    $first = $first.next();<br />
                    $(&quot;#outer div&quot;).css(&quot;background&quot;, &quot;green&quot;);<br />
                    $first.css(&quot;background&quot;, &quot;blue&quot;);<br />
                }<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        #outer div {<br />
            width: 20px;<br />
            height: 20px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
            float: left;<br />
            background: green;<br />
        }</p>
<p>        #outer .first {<br />
            background: blue;<br />
        }</p>
<p>        .prev, .next {<br />
            font-weight: bold;<br />
            font-size:30px;<br />
            padding:10px;<br />
            cursor:pointer;<br />
        }</p>
<p>        #container {<br />
            text-align: center;<br />
            width: 50%;<br />
            margin-left: 25%;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div id=&quot;container&quot;&gt;<br />
        &lt;div id=&quot;outer&quot;&gt;<br />
            &lt;div&gt;-6&lt;/div&gt;<br />
            &lt;div&gt;-5&lt;/div&gt;<br />
            &lt;div&gt;-4&lt;/div&gt;<br />
            &lt;div&gt;-3&lt;/div&gt;<br />
            &lt;div&gt;-2&lt;/div&gt;<br />
            &lt;div&gt;-1&lt;/div&gt;<br />
            &lt;div class=&quot;first&quot;&gt;0&lt;/div&gt;<br />
            &lt;div&gt;1&lt;/div&gt;<br />
            &lt;div&gt;2&lt;/div&gt;<br />
            &lt;div&gt;3&lt;/div&gt;<br />
            &lt;div&gt;4&lt;/div&gt;<br />
            &lt;div&gt;5&lt;/div&gt;<br />
            &lt;div&gt;6&lt;/div&gt;<br />
            &lt;div&gt;7&lt;/div&gt;<br />
        &lt;/div&gt;<br />
        &lt;div&gt;<br />
            &lt;table&gt;<br />
                &lt;tr&gt;<br />
                    &lt;td class=&quot;prev&quot; title=&quot;Previous&quot;&gt;&lt;&lt;&lt;&lt;/td&gt;<br />
                    &lt;td class=&quot;next&quot; title=&quot;Next&quot;&gt;&gt;&gt;&gt;&lt;/td&gt;<br />
                &lt;/tr&gt;<br />
            &lt;/table&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/custom-pager-using-prev-and-next-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Overwrite CSS Styles Using addClass In JQuery</title>
		<link>https://www.sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/</link>
					<comments>https://www.sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 00:06:18 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQuery addClass]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[Overwrite CSS Styles]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10811</guid>

					<description><![CDATA[In this post we will see how we can overwrite CSS styles using addClass method in jQuery. We have so many options to change the styles of a particular element. We can do it by editing the style sheet manually. But what if you want to do the same dynamically? If you need to change a CSS property dynamically, I suggest you to read it here: CSS Important . In this post we are applying more CSS rules to the same element. I hope you will like this. Here I am using jQuery 2.0.2 version, you can use whichever version [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can overwrite <a href="http://sibeeshpassion.com/category/css/" target="_blank">CSS </a>styles using addClass method in jQuery. We have so many options to change the styles of a particular element. We can do it by editing the style sheet manually. But what if you want to do the same dynamically? If you need to change a CSS property dynamically, I suggest you to read it here: <a href="http://sibeeshpassion.com/apply-css-important-in-jquery-and-css/" target="_blank">CSS Important </a>. In this post we are applying more CSS rules to the same element. I hope you will like this.</p>
<blockquote><p>Here I am using jQuery 2.0.2 version, you can use whichever version you like. </p></blockquote>
<p><strong>Background</strong></p>
<p>Recently I have got a requirement of changing a CSS property of an element which is common for element. So I wanted to change the CSS property only if my condition becomes true. In this situation I used jQuery addClass to do this requirement. Here I will show you how. </p>
<p><strong>Using the code</strong></p>
<p>First thing you need to do is create a page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;AddClass JQuery Demo &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
   AddClass JQuery Demo &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then you need to include the script needed.</p>
<p>[js]<br />
&lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now you need to write the scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            setTimeout(function () {<br />
				$(&#8216;.first&#8217;).addClass(&#8216;second&#8217;);<br />
			}, 5000);<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>We are adding a new CSS style <em>second </em> to a class <em>first </em>. We will add this after five seconds of document ready. So now we need to create the styles right?</p>
<p>[css]<br />
  &lt;style&gt;<br />
        .first {<br />
            width: 100px;<br />
	    height: 100px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
			background:green;<br />
        }<br />
	.second {<br />
            width: 200px;<br />
	    height: 200px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            background: blue;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now please run your browser, you can see the following output. </p>
<div id="attachment_10812" style="width: 303px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles.png"><img decoding="async" aria-describedby="caption-attachment-10812" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles.png" alt="Overwrite CSS Styles Using addClass" width="293" height="181" class="size-full wp-image-10812" /></a><p id="caption-attachment-10812" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>Now after five seconds, the same element will look as follows.</p>
<div id="attachment_10813" style="width: 324px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png"><img decoding="async" aria-describedby="caption-attachment-10813" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png" alt="Overwrite CSS Styles Using addClass" width="314" height="298" class="size-full wp-image-10813" srcset="/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png 314w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles1-300x285.png 300w" sizes="(max-width: 314px) 100vw, 314px" /></a><p id="caption-attachment-10813" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>If you look at your browser console, you can see both of the styles are applied to the element. </p>
<div id="attachment_10814" style="width: 610px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png"><img decoding="async" aria-describedby="caption-attachment-10814" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png" alt="Overwrite CSS Styles Using addClass" width="600" height="626" class="size-full wp-image-10814" srcset="/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png 600w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-288x300.png 288w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-400x417.png 400w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-575x600.png 575w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-10814" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>That&#8217;s all, now we can see the complete code here.</p>
<blockquote><p>Here I am using setTimeout as my condition, you can use any condition according to your requirement. </p></blockquote>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;AddClass JQuery Demo &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            setTimeout(function () {<br />
				$(&#8216;.first&#8217;).addClass(&#8216;second&#8217;);<br />
			}, 5000);<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        .first {<br />
            width: 100px;<br />
			height: 100px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
			background:green;<br />
        }<br />
		.second {<br />
            width: 200px;<br />
			height: 200px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            background: blue;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    AddClass JQuery Demo &#8211; Sibeesh Passion<br />
	&lt;div class=&quot;first&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Check for any unsaved changes in page</title>
		<link>https://www.sibeeshpassion.com/check-for-any-unsaved-changes-in-page/</link>
					<comments>https://www.sibeeshpassion.com/check-for-any-unsaved-changes-in-page/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 29 Sep 2015 00:04:14 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Check for any unsaved changes in page]]></category>
		<category><![CDATA[Show alert when there is unsaved changes]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10714</guid>

					<description><![CDATA[In this post we will discuss how we can check for any unsaved changes in the page by using JQuery. Normally this may need to be implemented in an application where we need to give any alert if any user try to reload the page when there any unsaved changes in the page. I hope you will like this. Background I was creating a page where I have some text boxes, So I wanted to give an alert if user try to get away from the page with out saving the data entered. Using the code First of all we [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can check for any unsaved changes in the page by using <a href="http://sibeeshpassion.com/tag/JQuery/" target="_blank">JQuery</a>. Normally this may need to be implemented in an application where we need to give any alert if any user try to reload the page when there any unsaved changes  in the page. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I was creating a page where I have some text boxes, So I wanted to give an alert if user try to get away from the page with out saving the data entered. </p>
<p><strong>Using the code</strong></p>
<p>First of all we will create a page and a html table.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Check for any unsaved changes in page&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;table class=&quot;table&quot; border=&quot;1&quot; style=&quot;width: 40%&quot;&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Sibi&lt;/td&gt;<br />
            &lt;td&gt;Ajay&lt;/td&gt;<br />
            &lt;td&gt;&lt;input class=&quot;text&quot; type=&quot;text&quot;  /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Ansu&lt;/td&gt;<br />
            &lt;td&gt;Akhil&lt;/td&gt;<br />
            &lt;td&gt;&lt;input class=&quot;text&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Shanto&lt;/td&gt;<br />
            &lt;td&gt;Libin&lt;/td&gt;<br />
            &lt;td&gt;&lt;input class=&quot;text&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p>Now if you run your page and, you can see the table.</p>
<div id="attachment_10716" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_11-e1443423241572.png"><img decoding="async" aria-describedby="caption-attachment-10716" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_11-e1443423241572.png" alt="Check for any unsaved changes in page" width="650" height="83" class="size-full wp-image-10716" srcset="/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_11-e1443423241572.png 650w, /wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_11-e1443423241572-300x38.png 300w, /wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_11-e1443423241572-400x51.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10716" class="wp-caption-text">Check for any unsaved changes in page</p></div>
<p>No we will create a bool variable which will be true when there is an unsaved data.</p>
<p>[js]<br />
var unsaved = false;<br />
[/js]</p>
<p>What next? We will add call to an existing function when user reloads the page. Sounds good?</p>
<p>[js]<br />
window.onbeforeunload = unloadPage;<br />
[/js]</p>
<p>As you can see we are calling a function <em>unloadPage</em>, preceding is the function definition.</p>
<p>[js]<br />
 function unloadPage() {<br />
            if (unsaved) {<br />
                return &quot;You have unsaved changes on this page.&quot;;<br />
            }<br />
        }<br />
[/js]</p>
<p>Now please run your page and type anything in the text box given, then reload your page.<br />
You will get an alert of <em>You have unsaved changes on this page.</em>. Shall we check that?</p>
<div id="attachment_10717" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_2-e1443423675762.png"><img decoding="async" aria-describedby="caption-attachment-10717" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_2-e1443423675762.png" alt="Check for any unsaved changes in page" width="650" height="260" class="size-full wp-image-10717" srcset="/wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_2-e1443423675762.png 650w, /wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_2-e1443423675762-300x120.png 300w, /wp-content/uploads/2015/09/Check_for_any_unsaved_changes_in_page_2-e1443423675762-400x160.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10717" class="wp-caption-text">Check for any unsaved changes in page</p></div>
<p>We have done it finally.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Check for any unsaved changes in page&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        var unsaved = false;<br />
        $(document).on(&#8216;change&#8217;, &#8216;.table .text&#8217;, function () {<br />
            unsaved = true;<br />
        });</p>
<p>        $(document).on(&#8216;mouseover&#8217;, &#8216;.table td&#8217;, function () {<br />
            $(this).attr(&#8216;title&#8217;, $(this).text());<br />
        });<br />
        function unloadPage() {<br />
            if (unsaved) {<br />
                return &quot;You have unsaved changes on this page.&quot;;<br />
            }<br />
        }<br />
        window.onbeforeunload = unloadPage;<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;table class=&quot;table&quot; border=&quot;1&quot; style=&quot;width: 40%&quot;&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Sibi&lt;/td&gt;<br />
            &lt;td&gt;Ajay&lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;input class=&quot;text&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Ansu&lt;/td&gt;<br />
            &lt;td&gt;Akhil&lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;input class=&quot;text&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;Shanto&lt;/td&gt;<br />
            &lt;td&gt;Libin&lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;input class=&quot;text&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever faced this requirement in your programming life? Does this article helps you in anyway? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can. Have a happy coding!.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/check-for-any-unsaved-changes-in-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working With Client Side Local Storage</title>
		<link>https://www.sibeeshpassion.com/working-with-client-side-local-storage/</link>
					<comments>https://www.sibeeshpassion.com/working-with-client-side-local-storage/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 03 Aug 2015 00:09:38 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Local Storage]]></category>
		<category><![CDATA[Storage in HTML5]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1411</guid>

					<description><![CDATA[[toc] Introduction In this article, we will learn how to use local storage in HTML5. For many years, we developers were depending on the server only for saving the data. And we used to retrieve the data by sending a request to our server and by manipulating some queries we could manage the formation, updating, insertion and so on. Great, we were doing a fantastic job. But as the day’s passes, we must move on to the next level. Nowadays all are busy in their life, so a person can wait a maximum of a few seconds for a request [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>
In this article, we will learn how to use local storage in HTML5. For many years, we developers were depending on the server only for saving the data. And we used to retrieve the data by sending a request to our server and by manipulating some queries we could manage the formation, updating, insertion and so on. Great, we were doing a fantastic job.</p>
<p>But as the day’s passes, we must move on to the next level. Nowadays all are busy in their life, so a person can wait a maximum of a few seconds for a request that he has given in your blog, or website, or in your product. If it takes much time, he/she will just close the window and start searching for an alternative. Am I right?</p>
<p>Yeah, it happens when you are depending completely on the server. For each query, it will take some seconds. Just because of this, we started using the client-side state management techniques, mostly cookies.</p>
<p>But we do have the following issues if we are using cookies also:</p>
<p>The cookies can have only a limited amount of data, which is definitely not enough for us to work on (4096 bytes).<br />
And as the number of requests increases, the data amount in cookies also increase. So at a point in time, we may encounter some performance issues. So in the modern web, we have a new solution, Local Storage.
</p>
<h3>Source Code</h3>
<p>Download the source code here: <a href="https://code.msdn.microsoft.com/Client-Side-Local-Storage-1db5f707" target="_blank">Local Storage </a></p>
<h3>Background</h3>
<p>Currently, I am working on a dashboard application. As you all know a dashboard application must be as fast as possible. It must not make a user wait. So most of our codes are on the client side. So we are storing the necessary data on the client side itself, that makes my app fast. And we are using jQuery.</p>
<h3>Using the code</h3>
<p>Now we will work on how to save the data in local storage and retrieve it when we need it.</p>
<h4>Saving the Data</h4>
<p>To save the data we do have a function called <em>setItem().</em> We can use the following syntax.</p>
<p>[js]<br />
localStorage.setItem(“item”, “http://sibeeshpassion.com/”)<br />
[/js]</p>
<p>Before going for this, you must check that your browser supports this feature since this is only applicable to modern browsers.</p>
<h4>To check whether it supports it or not:</h4>
<p>[js]<br />
if (localStorage) {<br />
}<br />
else {<br />
$(“#showitem”).text(“your browser does not support this feature”);<br />
}<br />
[/js]</p>
<h4>Retrieving the data from local storage</h4>
<p>We can use the <em>getItem() </em>function to retrieve the data from the local storage.</p>
<p>Please see the following syntax.<br />
[js]<br />
var itm = localStorage.getItem(“item”);<br />
[/js]</p>
<p>Great, you have it. Congratulations.</p>
<p>Now we will work on how to remove this item from local storage.</p>
<h4>Removing data from the local storage</h4>
<p>To remove the data form the local storage, please see the following syntax.<br />
[js]<br />
localStorage.removeItem(“item”);<br />
[/js]</p>
<h4>Removing the all data from localStorage</h4>
<p>To remove the data form the localStorage, please see the following syntax.<br />
[js]<br />
localStorage.clear();<br />
[/js]</p>
<h3>Demo</h3>
<p>Here we will create 3 buttons and one h2 tag as in the following markup.</p>
<p>[html]<br />
&lt;input type=“submit” id=“setitem” value=“set Item” /&gt;<br />
&lt;input type=“submit” id=“getitem” value=“get Item” /&gt;<br />
&lt;input type=“submit” id=“removeitem” value=“remove Item” /&gt;<br />
&lt;h2 id=“showitem”&gt;&lt;/h2&gt;<br />
[/html]</p>
<p>Now we will add the jQuery reference.</p>
<p>[js]<br />
&lt;script src=“jquery-1.11.1.min.js”&gt;&lt;/script&gt;<br />
[/js]</p>
<h4>Set the Item</h4>
<p>[js]<br />
$(“#setitem”).click(function () {<br />
localStorage.setItem(“item”, “http://sibeeshpassion.com/”)<br />
});<br />
[/js]</p>
<p>Once you set the item to localStorage, you can see it in your browser. To see it, press F12 after pressing the set Item button, then go to the resources tab.</p>
<p>Figure: Prior to setting the item</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/set_items_to_local_storage.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/set_items_to_local_storage.jpg" alt="set_items_to_local_storage" width="611" height="265" class="alignnone size-full wp-image-8501" srcset="/wp-content/uploads/2015/03/set_items_to_local_storage.jpg 611w, /wp-content/uploads/2015/03/set_items_to_local_storage-300x130.jpg 300w, /wp-content/uploads/2015/03/set_items_to_local_storage-400x173.jpg 400w" sizes="(max-width: 611px) 100vw, 611px" /></a></p>
<p>Figure: After setting the item</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/set_items_to_local_storage1.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/set_items_to_local_storage1.jpg" alt="set_items_to_local_storage1" width="692" height="297" class="alignnone size-full wp-image-8511" srcset="/wp-content/uploads/2015/03/set_items_to_local_storage1.jpg 634w, /wp-content/uploads/2015/03/set_items_to_local_storage1-300x129.jpg 300w, /wp-content/uploads/2015/03/set_items_to_local_storage1-400x172.jpg 400w" sizes="(max-width: 692px) 100vw, 692px" /></a></p>
<h4>Get the Item</h4>
<p>[js]<br />
$(“#getitem”).click(function () {<br />
                    var itm = localStorage.getItem(“item”)<br />
                    $(“#showitem”).text(itm);<br />
                });<br />
[/js]</p>
<h4>Remove the Item</h4>
<p>[js]<br />
$(“#removeitem”).click(function () {<br />
                    localStorage.removeItem(“item”);<br />
                    $(“#showitem”).text(”);<br />
                });<br />
[/js]</p>
<h3>Complete Code</h3>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=“http://www.w3.org/1999/xhtml”&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Use Of Local Storage – Sibeesh|Passion&lt;/title&gt;<br />
    &lt;script src=“jquery-1.11.1.min.js”&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(function () {<br />
            if (localStorage) {<br />
                $(“#setitem”).click(function () {<br />
                    localStorage.setItem(“item”, “http://sibeeshpassion.com/”)<br />
                });<br />
                $(“#getitem”).click(function () {<br />
                    var itm = localStorage.getItem(“item”)<br />
                    $(“#showitem”).text(itm);<br />
                });<br />
                $(“#removeitem”).click(function () {<br />
                    localStorage.removeItem(“item”);<br />
                    $(“#showitem”).text(”);<br />
                });<br />
            }<br />
            else {<br />
                $(“#showitem”).text(“your browser does not support this feature”);<br />
            }<br />
        });<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;input type=“submit” id=“setitem” value=“set Item” /&gt;<br />
    &lt;input type=“submit” id=“getitem” value=“get Item” /&gt;<br />
    &lt;input type=“submit” id=“removeitem” value=“remove Item” /&gt;<br />
    &lt;h2 id=“showitem”&gt;&lt;/h2&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<h3>Conclusion</h3>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/working-with-client-side-local-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Basic Difference Between Local Storage and Session Storage in HTML 5</title>
		<link>https://www.sibeeshpassion.com/basic-difference-between-local-storage-and-session-storage-in-html-5/</link>
					<comments>https://www.sibeeshpassion.com/basic-difference-between-local-storage-and-session-storage-in-html-5/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 29 Mar 2015 20:14:03 +0000</pubDate>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Difference between local storage and session storage]]></category>
		<category><![CDATA[Local Storage]]></category>
		<category><![CDATA[Session Storage]]></category>
		<category><![CDATA[Storage in HTML5]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1501</guid>

					<description><![CDATA[[toc] Introduction This article explains what is the basic difference between HTML 5 local storage and session storage. Basically, both session storage and local storage are part of storage mechanism which is introduced with HTML5. By using these two, we can store information on client side itself. I hope you will like it. If you are new to the term local storage, I recommend you to read my article here: Local Storage Basic scenario where you can use If you need to carry a value throughout your application or throughout your pages, you can use local storage. For example, we [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>
This article explains what is the basic difference between HTML 5 local storage and session storage. Basically, both session storage and local storage are part of storage mechanism which is introduced with HTML5. By using these two, we can store information on client side itself.  I hope you will like it.</p>
<p>If you are new to the term local storage, I recommend you to read my article here: <a href="http://sibeeshpassion.com/working-with-client-side-local-storage/" target="_blank">Local Storage</a></p>
<p><h3>Basic scenario where you can use</h3>
<p>
If you need to carry a value throughout your application or throughout your pages, you can use local storage. For example, we can store a logged-in username in local storage that we may need to access all the pages. I strongly recommend to not store any secured data (for example a “password”) in local storage.</p>
<p>In some scenario, we may need to set a key element depending on the pages we have in the application. For example, if we need to store the page name (any key element that may be different).<br />
So let’s start</p>
<p><h3>Using the code</h3>
<p>
Here in my application, I have added two HTML5 pages.</p>
<p><em>HtmlPage1.html</em><br />
<em>HtmlPage2.html</em></p>
<p>In <em>HtmlPage1.html</em> I have set local storage and session storage, now I am trying to access that in <em>HtmlPage2.html</em>. Please see the following source.</p>
<p><em>HtmlPage1.html</em><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html<br />
    xmlns=“http://www.w3.org/1999/xhtml”&gt;<br />
    &lt;head&gt;<br />
        &lt;title&gt;Difference between local storage and session storage&lt;/title&gt;<br />
        &lt;script&gt;<br />
            localStorage.setItem(“myKey”, 1);<br />
            sessionStorage.setItem(“myKey”, 1);<br />
            var myVal = localStorage.getItem(“myKey”);<br />
            alert(“My local storage value is : ” + myVal);<br />
            alert(“My session storage value is : ” + sessionStorage.getItem(“myKey”));<br />
        &lt;/script&gt;<br />
    &lt;/head&gt;<br />
    &lt;body&gt;<br />
    &lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><em>HtmlPage2.html</em><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html<br />
    xmlns=“http://www.w3.org/1999/xhtml”&gt;<br />
    &lt;head&gt;<br />
        &lt;title&gt;Difference between local storage and session storage&lt;/title&gt;<br />
        &lt;script&gt;<br />
            var myVal = localStorage.getItem(“myKey”);<br />
            alert(“My local storage value is : ” + myVal);<br />
            alert(“My session storage value is : ” + sessionStorage.getItem(“myKey”));<br />
        &lt;/script&gt;<br />
    &lt;/head&gt;<br />
    &lt;body&gt;<br />
    &lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>When you run the first page, in the browser console you will see as in the following image.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/local-storage.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/local-storage.jpg" alt="local storage" width="624" height="135" class="alignnone size-full wp-image-8461" srcset="/wp-content/uploads/2015/03/local-storage.jpg 624w, /wp-content/uploads/2015/03/local-storage-300x65.jpg 300w, /wp-content/uploads/2015/03/local-storage-620x135.jpg 620w, /wp-content/uploads/2015/03/local-storage-400x87.jpg 400w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>Figure: Local Storage</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/session-storage.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/session-storage.jpg" alt="session storage" width="624" height="135" class="alignnone size-full wp-image-8462" srcset="/wp-content/uploads/2015/03/session-storage.jpg 624w, /wp-content/uploads/2015/03/session-storage-300x65.jpg 300w, /wp-content/uploads/2015/03/session-storage-620x135.jpg 620w, /wp-content/uploads/2015/03/session-storage-400x87.jpg 400w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>Figure: Session Storage</p>
<p>Now it is time to run the second page. Once you run that please check in the console. You can see as follows.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/htmlpage2-local-storage.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/htmlpage2-local-storage.jpg" alt="htmlpage2 local storage" width="624" height="301" class="alignnone size-full wp-image-8471" srcset="/wp-content/uploads/2015/03/htmlpage2-local-storage.jpg 624w, /wp-content/uploads/2015/03/htmlpage2-local-storage-300x145.jpg 300w, /wp-content/uploads/2015/03/htmlpage2-local-storage-400x193.jpg 400w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>Figure: Local storage</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/htmlpage2-session-storage.jpg"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/htmlpage2-session-storage.jpg" alt="htmlpage2 session storage" width="624" height="307" class="alignnone size-full wp-image-8481" srcset="/wp-content/uploads/2015/03/htmlpage2-session-storage.jpg 624w, /wp-content/uploads/2015/03/htmlpage2-session-storage-300x148.jpg 300w, /wp-content/uploads/2015/03/htmlpage2-session-storage-400x197.jpg 400w" sizes="(max-width: 624px) 100vw, 624px" /></a></p>
<p>Figure: Session storage</p>
<p>Please note that session storage is null. You can see the session storage only if you set it on that running page.
</p>
<h3>Conclusion</h3>
<p>
Thanks a lot for reading. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.
</p>
<h3>Your turn. What do you think?</h3>
<p>
A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.
</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/basic-difference-between-local-storage-and-session-storage-in-html-5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating Custom Color Palette Using JQuery, HTML5, CSS</title>
		<link>https://www.sibeeshpassion.com/creating-custom-color-palette-using-jquery-html5-css/</link>
					<comments>https://www.sibeeshpassion.com/creating-custom-color-palette-using-jquery-html5-css/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 29 Mar 2015 20:11:35 +0000</pubDate>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Colour Palette]]></category>
		<category><![CDATA[Colour Palette in JQuery]]></category>
		<category><![CDATA[Create Custom Colour Palette]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1441</guid>

					<description><![CDATA[Today I came across a requirement to integrate a colour palette into my application. When I searched for that, unfortunately I could not find any solution . So I thought of creating a custom color palette tool. This article explains how to do this. I will use this tool in my high chart application. I hope you will like it. Please see the following image if you do not know what a colour palette is. Background I am working in a dashboard application, where you can find many charts, maps and grids and so on. If you work with a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today I came across a requirement to integrate a colour palette into my application. When I searched for that, unfortunately I could not find any solution . So I thought of creating a custom color palette tool. This article explains how to do this. I will use this tool in my high chart application. I hope you will like it. Please see the following image if you do not know what a colour palette is.</p>
<p><strong>Background</strong></p>
<p>I am working in a dashboard application, where you can find many charts, maps and grids and so on. If you work with a chart, you will definitely know the word series . Previously we were applying the color for every series separately, in other words the user must select the color for each series or it will take some default color. Your user may think this process is too much work. Here I am providing a custom color palette control.</p>
<p><strong>Download Source Code</strong></p>
<p><a href="http://sibeeshpassion.com/download/ColorPalette.rar" target="_blank">Custom Colour Palette</a></p>
<p><strong>Why</strong></p>
<p>Instead of applying colors separately, we can just select a palette so that the colors set in the selected palette will be applied automatically as in Excel.</p>
<p><strong>Using the code</strong></p>
<p>I am using <em>jquery-1.9.1.js</em> for the implementation in my application, you can get this file from the attached application. </p>
<p>Once you include the jQuery file, please create an HTML5 page as shown below.<br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;  </p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Include the jQuery reference as in the following</strong><br />
[js]<br />
&lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now to replace our body tag as shown below<br />
[html]<br />
&lt;body&gt;<br />
    &lt;header style=&quot;text-align:center&quot;&gt; Custom Color Palette &#8211; sibeeshpassion&lt;/header&gt;  </p>
<p>    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    Change Series Color:<br />
    &lt;label id=&quot;changecolor&quot; title=&quot;Change Color&quot;&gt;&lt;u&gt;&lt;i&gt;Change Color&lt;/i&gt;&lt;/u&gt;&lt;/label&gt;<br />
    &lt;ul class=&quot;containerul&quot;&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette I :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F29F98&quot; style=&quot;background-color: #F29F98&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F27C72&quot; style=&quot;background-color: #F27C72&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F15C4E&quot; style=&quot;background-color: #F15C4E&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#F03B2A&quot; style=&quot;background-color: #F03B2A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F12815&quot; style=&quot;background-color: #F12815&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FF1601&quot; style=&quot;background-color: #FF1601&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette II :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#A3F0BE&quot; style=&quot;background-color: #A3F0BE&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#7FEBA5&quot; style=&quot;background-color: #7FEBA5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#48EB81&quot; style=&quot;background-color: #48EB81&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#25EB6B&quot; style=&quot;background-color: #25EB6B&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#14E85E&quot; style=&quot;background-color: #14E85E&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#03E552&quot; style=&quot;background-color: #03E552&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette III :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F48A8A&quot; style=&quot;background-color: #F48A8A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F57777&quot; style=&quot;background-color: #F57777&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FA2A2A&quot; style=&quot;background-color: #FA2A2A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#FC0909&quot; style=&quot;background-color: #FC0909&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#EF0505&quot; style=&quot;background-color: #EF0505&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FF0000&quot; style=&quot;background-color: #FF0000&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette IV :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#C3A1E9&quot; style=&quot;background-color: #C3A1E9&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#AF7AEC&quot; style=&quot;background-color: #AF7AEC&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#A25CF2&quot; style=&quot;background-color: #A25CF2&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#8D32F5&quot; style=&quot;background-color: #8D32F5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#811CF5&quot; style=&quot;background-color: #811CF5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#790AF9&quot; style=&quot;background-color: #790AF9&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
    &lt;/ul&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    Here colors will be changed whenever you select the palette 🙂<br />
    &lt;div id=&quot;checker&quot; class=&quot;outputcontainer&quot;&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p>Here what I am doing is, I am creating a ul element and inside that I am creating some p elements with span. Please see that in the preceding HTML element section.</p>
<p>Once you are done with the elements, what would be the next step? Yeah, we need to style them. Please include the following styles.<br />
[css]<br />
&lt;style&gt;<br />
        .simplebox {<br />
            cursor: pointer;<br />
            border: 1px solid #f0f8ff;<br />
            float: left;<br />
            margin: 1px;<br />
            width: 20px;<br />
            height: 20px;<br />
        }  </p>
<p>        .simpleboxdynamic {<br />
            cursor: pointer;<br />
            border: 1px solid #f0f8ff;<br />
            float: left;<br />
            margin: 1px;<br />
            width: 99.3%;<br />
            height: 27px;<br />
            padding: 5px;<br />
            border-radius: 3px;<br />
            text-align: center;<br />
        }  </p>
<p>        .boxspecialone {<br />
            border: 1px solid #ff00ff;<br />
        }  </p>
<p>        .boxcontainer {<br />
            border: 1px solid #ccc;<br />
            width: 165px;<br />
            position: relative;<br />
            height: 50px;<br />
            padding: 2px;<br />
        }  </p>
<p>        .boxcheckbox {<br />
            float: right;<br />
            margin-top: 6px;<br />
        }  </p>
<p>        .outputcontainer {<br />
            border: 1px solid #ccc;<br />
            width: 100%;<br />
            position: relative;<br />
            height: 247px;<br />
            margin-top: 5px;<br />
        }  </p>
<p>        .maincontainer {<br />
            display: none;<br />
        }  </p>
<p>        .containerul {<br />
            position: absolute;<br />
            width: 190px;<br />
            list-style: none;<br />
            margin: 4px;<br />
            /*border: 2px solid #29b8e5;*/<br />
            -webkit-border-radius: 5px;<br />
            -moz-border-radius: 5px;<br />
            border-radius: 5px;<br />
            background-color: #ffffff;<br />
            overflow-y: auto;<br />
            overflow-x: hidden;<br />
            display: block;<br />
            margin-left: 0px;<br />
            z-index: 200;<br />
            height: 305px;<br />
            display: none;<br />
            left: 60px;<br />
        }  </p>
<p>        #changecolor {<br />
            cursor: pointer;<br />
        }<br />
&lt;/style&gt;<br />
[/css]</p>
<p>Our next step is writing the scripts. Please see that below.<br />
[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            $(&quot;#changecolor&quot;).click(function () {<br />
                $(&quot;.containerul&quot;).slideToggle(1000);<br />
            });<br />
            $(&quot;.boxcheckbox&quot;).click(function () {<br />
                $(&quot;#checker&quot;).html(&#8221;);<br />
                //checked true only for the current<br />
                $(&quot;.boxcheckbox&quot;).prop(&quot;checked&quot;, false);<br />
                $(this).prop(&quot;checked&quot;, true);<br />
                //bind colors start<br />
                var colorCount = 0;<br />
                var spans = $(this).parent().find(&#8216;span&#8217;);<br />
                var test = &#8216;&lt;div&gt;&lt;/div&gt;&#8217;;<br />
                $.each(spans, function (key, value) {<br />
                    var color = $(value).attr(&#8216;title&#8217;);<br />
                    var p = &#8216;&lt;p style=&quot;background-color:&#8217; + color + &#8216;&quot; class=&quot;simpleboxdynamic&quot;&gt; Color Key :&#8217; + key + &#8216;&lt;/p&gt;&#8217;;<br />
                    $(&quot;#checker&quot;).append(p);<br />
                });<br />
            });<br />
        });<br />
&lt;/script&gt;<br />
[/js]</p>
<p>In the script, I am calling the checked event of the check boxes inside the p element and whenever a user selects one, I am finding the parent colors and applying that to the output UI.<br />
That is all. Cool, we have done it.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Custom Color Palette &#8211; sibeeshpassion&lt;/title&gt;<br />
    &lt;style&gt;<br />
        .simplebox {<br />
            cursor: pointer;<br />
            border: 1px solid #f0f8ff;<br />
            float: left;<br />
            margin: 1px;<br />
            width: 20px;<br />
            height: 20px;<br />
        }  </p>
<p>        .simpleboxdynamic {<br />
            cursor: pointer;<br />
            border: 1px solid #f0f8ff;<br />
            float: left;<br />
            margin: 1px;<br />
            width: 99.3%;<br />
            height: 27px;<br />
            padding: 5px;<br />
            border-radius: 3px;<br />
            text-align: center;<br />
        }  </p>
<p>        .boxspecialone {<br />
            border: 1px solid #ff00ff;<br />
        }  </p>
<p>        .boxcontainer {<br />
            border: 1px solid #ccc;<br />
            width: 165px;<br />
            position: relative;<br />
            height: 50px;<br />
            padding: 2px;<br />
        }  </p>
<p>        .boxcheckbox {<br />
            float: right;<br />
            margin-top: 6px;<br />
        }  </p>
<p>        .outputcontainer {<br />
            border: 1px solid #ccc;<br />
            width: 100%;<br />
            position: relative;<br />
            height: 247px;<br />
            margin-top: 5px;<br />
        }  </p>
<p>        .maincontainer {<br />
            display: none;<br />
        }  </p>
<p>        .containerul {<br />
            position: absolute;<br />
            width: 190px;<br />
            list-style: none;<br />
            margin: 4px;<br />
            /*border: 2px solid #29b8e5;*/<br />
            -webkit-border-radius: 5px;<br />
            -moz-border-radius: 5px;<br />
            border-radius: 5px;<br />
            background-color: #ffffff;<br />
            overflow-y: auto;<br />
            overflow-x: hidden;<br />
            display: block;<br />
            margin-left: 0px;<br />
            z-index: 200;<br />
            height: 305px;<br />
            display: none;<br />
            left: 60px;<br />
        }  </p>
<p>        #changecolor {<br />
            cursor: pointer;<br />
        }<br />
    &lt;/style&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            $(&quot;#changecolor&quot;).click(function () {<br />
                $(&quot;.containerul&quot;).slideToggle(1000);<br />
            });<br />
            $(&quot;.boxcheckbox&quot;).click(function () {<br />
                $(&quot;#checker&quot;).html(&#8221;);<br />
                //checked true only for the current<br />
                $(&quot;.boxcheckbox&quot;).prop(&quot;checked&quot;, false);<br />
                $(this).prop(&quot;checked&quot;, true);<br />
                //bind colors start<br />
                var colorCount = 0;<br />
                var spans = $(this).parent().find(&#8216;span&#8217;);<br />
                var test = &#8216;&lt;div&gt;&lt;/div&gt;&#8217;;<br />
                $.each(spans, function (key, value) {<br />
                    var color = $(value).attr(&#8216;title&#8217;);<br />
                    var p = &#8216;&lt;p style=&quot;background-color:&#8217; + color + &#8216;&quot; class=&quot;simpleboxdynamic&quot;&gt; Color Key :&#8217; + key + &#8216;&lt;/p&gt;&#8217;;<br />
                    $(&quot;#checker&quot;).append(p);<br />
                });<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;header style=&quot;text-align:center&quot;&gt; Custom Color Palette &#8211; sibeeshpassion&lt;/header&gt;  </p>
<p>    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    Change Series Color:<br />
    &lt;label id=&quot;changecolor&quot; title=&quot;Change Color&quot;&gt;&lt;u&gt;&lt;i&gt;Change Color&lt;/i&gt;&lt;/u&gt;&lt;/label&gt;<br />
    &lt;ul class=&quot;containerul&quot;&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette I :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F29F98&quot; style=&quot;background-color: #F29F98&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F27C72&quot; style=&quot;background-color: #F27C72&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F15C4E&quot; style=&quot;background-color: #F15C4E&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#F03B2A&quot; style=&quot;background-color: #F03B2A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F12815&quot; style=&quot;background-color: #F12815&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FF1601&quot; style=&quot;background-color: #FF1601&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette II :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#A3F0BE&quot; style=&quot;background-color: #A3F0BE&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#7FEBA5&quot; style=&quot;background-color: #7FEBA5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#48EB81&quot; style=&quot;background-color: #48EB81&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#25EB6B&quot; style=&quot;background-color: #25EB6B&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#14E85E&quot; style=&quot;background-color: #14E85E&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#03E552&quot; style=&quot;background-color: #03E552&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette III :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F48A8A&quot; style=&quot;background-color: #F48A8A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#F57777&quot; style=&quot;background-color: #F57777&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FA2A2A&quot; style=&quot;background-color: #FA2A2A&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#FC0909&quot; style=&quot;background-color: #FC0909&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#EF0505&quot; style=&quot;background-color: #EF0505&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#FF0000&quot; style=&quot;background-color: #FF0000&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
        &lt;li&gt;<br />
            &lt;p class=&quot;boxcontainer&quot;&gt;<br />
                Color Palette IV :<br />
                &lt;br /&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#C3A1E9&quot; style=&quot;background-color: #C3A1E9&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#AF7AEC&quot; style=&quot;background-color: #AF7AEC&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#A25CF2&quot; style=&quot;background-color: #A25CF2&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox boxspecialone&quot; title=&quot;#8D32F5&quot; style=&quot;background-color: #8D32F5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#811CF5&quot; style=&quot;background-color: #811CF5&quot;&gt;&lt;/span&gt;<br />
                &lt;span class=&quot;simplebox&quot; title=&quot;#790AF9&quot; style=&quot;background-color: #790AF9&quot;&gt;&lt;/span&gt;<br />
                &lt;input type=&quot;checkbox&quot; class=&quot;boxcheckbox&quot; /&gt;<br />
            &lt;/p&gt;<br />
        &lt;/li&gt;<br />
    &lt;/ul&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    Here colors will be changed whenever you select the palette 🙂<br />
    &lt;div id=&quot;checker&quot; class=&quot;outputcontainer&quot;&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Output</strong></p>
<div id="attachment_9211" style="width: 634px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/Create-Custom-Colour-Palette.jpg"><img decoding="async" aria-describedby="caption-attachment-9211" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/Create-Custom-Colour-Palette.jpg" alt="Create Custom Colour Palette" width="624" height="288" class="size-full wp-image-9211" srcset="/wp-content/uploads/2015/03/Create-Custom-Colour-Palette.jpg 624w, /wp-content/uploads/2015/03/Create-Custom-Colour-Palette-300x138.jpg 300w, /wp-content/uploads/2015/03/Create-Custom-Colour-Palette-400x185.jpg 400w" sizes="(max-width: 624px) 100vw, 624px" /></a><p id="caption-attachment-9211" class="wp-caption-text">Create Custom Colour Palette</p></div>
<p><strong>Conclusion</strong></p>
<p>I hope you liked this article. Please provide your valuable suggestions.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/creating-custom-color-palette-using-jquery-html5-css/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>HTML 5 Elements in a Look: Part 3</title>
		<link>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-3/</link>
					<comments>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-3/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 29 Jan 2015 19:43:00 +0000</pubDate>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[HTML5 Video]]></category>
		<category><![CDATA[Video Implementation in HTML5]]></category>
		<category><![CDATA[Video Tag]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=941</guid>

					<description><![CDATA[Introduction If you are new to HTML 5, I suggest you to read my other article parts here: HTML 5 Elements in a Look: Part 1 HTML 5 Elements in a Look: Part 2 Introduction to HTML5 Video Before going through the video part, let us return to our previous version of HTML and discuss what all the issues are that we have encountered with those versions for playing the videos. I will list the following problems: We wanted to have an external plug in like Flash to play the video in our page. There were no specific standard tags for playing [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction </strong></p>
<p>If you are new to HTML 5, I suggest you to read my other article parts here:</p>
<li><a href="http://sibeeshpassion.com/html-5-elements-in-a-look-part-1/">HTML 5 Elements in a Look: Part 1</a></li>
<li><a href="http://sibeeshpassion.com/html-5-elements-in-a-look-part-2/">HTML 5 Elements in a Look: Part 2</a></li>
<p><strong>Introduction to HTML5 Video</strong></p>
<p>Before going through the video part, let us return to our previous version of HTML and discuss what all the issues are that we have encountered with those versions for playing the videos.</p>
<p>I will list the following problems:</p>
<li>We wanted to have an external plug in like Flash to play the video in our page.</li>
<li>There were no specific standard tags for playing the video.</li>
<p>HTML5 has introduced a new element &lt;video&gt;. Let us see how to use that element.</p>
<p>[html]<br />
&lt;video width=“500” controls&gt;<br />
&lt;source src=“sibi.mp4″ type=“video/mp4″&gt;<br />
It seems your browser is an outdated one, be new year.<br />
&lt;/video&gt;<br />
[/html]</p>
<p>Please find that I have added only a MP4 type. You can add the ogg type as follows:</p>
<p>[html]<br />
&lt;source src=“mov_bbb.ogg” type=“video/ogg”&gt;<br />
[/html]</p>
<p><strong>Complete Markup</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;title&gt;HTML5 Video -Sibeesh Passion&lt;/title&gt;<br />
&lt;body&gt;<br />
    &lt;div&gt;<br />
        &lt;video width=“500” controls&gt;<br />
            &lt;source src=” sibi.mp4″ type=“video/mp4″&gt;<br />
            It seems your browser is outdated one, be new yaar.<br />
        &lt;/video&gt;<br />
        &lt;div&gt;<br />
            &lt;a href=“Your video URL here”&gt;Your video URL here&lt;/a&gt;.<br />
        &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Please note that this tag won&#8217;t be supported in IE 8 and below.</p>
<p><strong>Points to remember</strong></p>
<p>Here are some points that you must remember:</p>
<li>The text “controls“ in the video markup is for adding the video player controls like play, pause and so on.</li>
<li>The text “It seems your browser is outdated one, be new yaar.” Will display only if your browser won&#8217;t support HTML5.</li>
<li>It is always good to set the width for the video element to avoid the flickering in the browser.</li>
<p><strong>Adding your own controls (play, pause and so on)</strong></p>
<p>You can also add your own controls like play and pause to the video element, if you don&#8217;t want to have the built-in control functionality.</p>
<p><strong>Procedure:</strong></p>
<ul>
<li>You must remove the text controls from the element first.</li>
<li>Add the video tag.</li>
<p>         [html]<br />
&lt;video id=“video1″ width=“500”&gt;<br />
&lt;source src=“sibi.mp4″ type=“video/mp4″&gt;<br />
&lt;source src=“sibi.ogg” type=“video/ogg”&gt;<br />
It seems your browser is outdated one, be new yaar.<br />
&lt;/video&gt;<br />
[/html]</p>
<li>Add UI elements</li>
<p>[html]<br />
&lt;table&gt;<br />
       &lt;tr&gt;<br />
           &lt;td&gt;<br />
               &lt;div onclick=“playOrpause()”&gt;Play/Pause&lt;/div&gt;<br />
           &lt;/td&gt;<br />
           &lt;td&gt;<br />
               &lt;div onclick=“big()”&gt;Big&lt;/div&gt;<br />
           &lt;/td&gt;<br />
           &lt;td&gt;<br />
               &lt;div onclick=“small()”&gt;Small&lt;/div&gt;<br />
           &lt;/td&gt;<br />
           &lt;td&gt;<br />
               &lt;div onclick=“normal()”&gt;Normal&lt;/div&gt;<br />
           &lt;/td&gt;<br />
       &lt;/tr&gt;<br />
   &lt;/table&gt;<br />
[/html]</p>
<li>Create the functions in the scripts</li>
<p>[html]<br />
&lt;script&gt;<br />
        var myVideo = document.getElementById(“video1″);<br />
        function playOrpause() {<br />
            if (myVideo.paused)<br />
                myVideo.play();<br />
            else<br />
                myVideo.pause();<br />
        }<br />
        function big() {<br />
            myVideo.width = 560;<br />
        }<br />
        function small() {<br />
            myVideo.width = 320;<br />
        }<br />
        function normal() {<br />
            myVideo.width = 420;<br />
        }<br />
    &lt;/script&gt;<br />
[/html]
</ul>
<p><strong>Complete Markup</strong><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
    &lt;script src=“jquery-1.9.1.js”&gt;&lt;/script&gt;<br />
    &lt;div&gt;<br />
        &lt;table&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;<br />
                    &lt;div onclick=“playOrpause()”&gt;Play/Pause&lt;/div&gt;<br />
                &lt;/td&gt;<br />
                &lt;td&gt;<br />
                    &lt;div onclick=“big()”&gt;Big&lt;/div&gt;<br />
                &lt;/td&gt;<br />
                &lt;td&gt;<br />
                    &lt;div onclick=“small()”&gt;Small&lt;/div&gt;<br />
                &lt;/td&gt;<br />
                &lt;td&gt;<br />
                    &lt;div onclick=“normal()”&gt;Normal&lt;/div&gt;<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
        &lt;/table&gt;<br />
        &lt;br&gt;<br />
        &lt;video id=“video1″ width=“500”&gt;<br />
            &lt;source src=“sibi.mp4″ type=“video/mp4″&gt;<br />
            &lt;source src=“sibi.ogg” type=“video/ogg”&gt;<br />
            It seems your browser is outdated one, be new yaar.<br />
        &lt;/video&gt;<br />
    &lt;/div&gt;<br />
    &lt;script&gt;<br />
        var myVideo = document.getElementById(“video1″);<br />
        function playOrpause() {<br />
            if (myVideo.paused)<br />
                myVideo.play();<br />
            else<br />
                myVideo.pause();<br />
        }<br />
        function big() {<br />
            myVideo.width = 560;<br />
        }<br />
        function small() {<br />
            myVideo.width = 320;<br />
        }<br />
        function normal() {<br />
            myVideo.width = 420;<br />
        }<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Wow, we have created our own controls.</p>
<p>Cool. That is all for today.</p>
<p>See you soon in the next part with another control. Please provide your valuable comments.</p>
<p>Kindest regards,</p>
<p><a href="http://sibeeshpassion.com/" rel="nofollow">Sibeesh Venu.</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>HTML 5 Elements in a Look: Part 1</title>
		<link>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-1/</link>
					<comments>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-1/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 29 Jan 2015 19:39:28 +0000</pubDate>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Character Encoding in HTML5]]></category>
		<category><![CDATA[Creating new element in HTML5]]></category>
		<category><![CDATA[HTML5 Declaration]]></category>
		<category><![CDATA[Structure of HTML5]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=881</guid>

					<description><![CDATA[HTML 5 Introduction We all are familiar with HTML. Now HTML 5 is the latest version of markup language. HTML 5 has a semantic structure. In HTML 5 we have been given with some controls that will save your time when developing. Now we will see what all the controls and features are that were introduced in HTML 5. Before we start, please ensure that you have installed Visual Studio 2010 SP1 (or later). Then enable the HTML option in the target section. Got to Tools -&#62; Options -&#62; Text Editor -&#62; HTML. HTML 5 Markup The DOCTYPE declaration [html] [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>HTML 5 Introduction</strong></p>
<p>We all are familiar with HTML. Now HTML 5 is the latest version of markup language. HTML 5 has a semantic structure. In HTML 5 we have been given with some controls that will save your time when developing. Now we will see what all the controls and features are that were introduced in HTML 5.</p>
<p>Before we start, please ensure that you have <a href="https://www.microsoft.com/en-us/download/details.aspx?id=23691" rel="nofollow">installed Visual Studio 2010 SP1</a> (or later).</p>
<p>Then enable the HTML option in the target section.</p>
<p>Got to Tools -&gt; Options -&gt; Text Editor -&gt; HTML.</p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/html-5-elements-in-a-look-part-1/Images/html.jpg" alt="html" /></p>
<p><strong>HTML 5 Markup</strong></p>
<p><strong>The DOCTYPE declaration </strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
[/html]</p>
<p><strong>The character encoding (charset) declaration</strong><br />
[html]<br />
&lt;meta charset=“UTF-8″&gt;<br />
[/html]</p>
<p><strong>HTML 5 Example</strong><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta charset=“UTF-8″&gt;<br />
&lt;title&gt;Sibeesh Passion wish you a happy new year&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
Welcome to Sibeesh Passion&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Structure of HTML5</strong></p>
<p>As I said earlier, HTML 5 has a semantic structure. It reduces the efforts of a UI developer. The following image will explain the structure.</p>
<p><strong>Before Introducing HTML 5</strong></p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/html-5-elements-in-a-look-part-1/Images/Before%20Introducing%20HTML%205.jpg" alt="Before Introducing HTML 5" /></p>
<p><strong>After Introducing HTML 5</strong></p>
<p><img decoding="async" src="http://www.c-sharpcorner.com/UploadFile/65794e/html-5-elements-in-a-look-part-1/Images/After%20Introducing%20HTML%205.jpg" alt="After Introducing HTML 5" /></p>
<p>As you can see in the preceding image, HTML 5 has introduced new tags.</p>
<ul>
<li>Header</li>
<li>Nav</li>
<li>Section</li>
<li>Aside</li>
<li>Article</li>
<li>footer</li>
</ul>
<p><strong>Adding our own elements!</strong></p>
<p>Yes it is true, we can create our own element by introducing some styles, now we will see how to do this.</p>
<p>To do this we need a markup as follows.<br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
  &lt;title&gt;Your own element &lt;/title&gt;<br />
  &lt;script&gt;document.createElement(“yourelement”)&lt;/script&gt;<br />
  &lt;style&gt;<br />
 yourelement {<br />
    display: block;<br />
  }<br />
  &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div&gt;<br />
Normal element<br />
&lt;/div&gt;<br />
&lt; yourelement &gt;My element&lt;/ yourelement &gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
  &lt;title&gt;Your own element &lt;/title&gt;<br />
  &lt;script&gt;document.createElement(“yourelement”)&lt;/script&gt;<br />
  &lt;style&gt;<br />
 yourelement {<br />
    display: block;<br />
  }<br />
  &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div&gt;<br />
Normal element<br />
&lt;/div&gt;<br />
&lt; yourelement &gt;My element&lt;/ yourelement &gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Please note that we have created a new element <em>yourelement</em>.</p>
<p>Cool.</p>
<p>See you soon in the next part.</p>
<p>Kindest Regards,</p>
<p><a href="http://sibeeshpassion.com/" rel="nofollow">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>HTML 5 Elements in a Look: Part II</title>
		<link>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-2/</link>
					<comments>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-2/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 29 Jan 2015 19:37:23 +0000</pubDate>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Declaring Canvas]]></category>
		<category><![CDATA[Declaring SVG]]></category>
		<category><![CDATA[How to use Canvas]]></category>
		<category><![CDATA[How to use SVG]]></category>
		<category><![CDATA[HTML5 Canvas]]></category>
		<category><![CDATA[Implementing Canvas in HTML5]]></category>
		<category><![CDATA[SVG creation]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=841</guid>

					<description><![CDATA[Introduction If you are new to HTML 5, I suggest you to read my first part article here: HTML 5 Elements in a Look: Part 1. New Attribute syntax In HTML 5, we have new attribute syntax as in the following: Empty Unquoted Double Quoted Single Quoted Example We can assign the text property of an input type as follows. [js] &#60;input type=”text” value=”Sibeesh” disabled&#62; &#60;input type=”text” value=Sibeesh&#62; &#60;input type=”text” value=”Sibeesh” &#62; &#60;input type=”text” value=’Sibeesh’ &#62; [/js] To make IE lower versions to read HTML5 elements: Add The Shiv [js] &#60;!–[if lt IE 9]&#62; &#60;script src=“http://html5shiv.googlecode.com/svn/trunk/html5.js”&#62;&#60;/script&#62; &#60;![endif]–&#62; [/js] Apply CSS [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>If you are new to HTML 5, I suggest you to read my first part article here: <a href="http://www.c-sharpcorner.com/UploadFile/65794e/html-5-elements-in-a-look-part-1/">HTML 5 Elements in a Look: Part 1</a>.</p>
<p><strong>New Attribute syntax</strong></p>
<p>In HTML 5, we have new attribute syntax as in the following:</p>
<ul>
<li>Empty</li>
<li>Unquoted</li>
<li>Double Quoted</li>
<li>Single Quoted</li>
</ul>
<p><strong>Example</strong></p>
<p>We can assign the text property of an input type as follows.</p>
<p>[js]<br />
&lt;input type=”text” value=”Sibeesh” disabled&gt;<br />
&lt;input type=”text” value=Sibeesh&gt;<br />
&lt;input type=”text” value=”Sibeesh” &gt;<br />
&lt;input type=”text” value=’Sibeesh’ &gt;<br />
[/js]</p>
<p>To make IE lower versions to read HTML5 elements:</p>
<p>Add <strong>The Shiv</strong><br />
[js]<br />
&lt;!–[if lt IE 9]&gt;<br />
&lt;script src=“http://html5shiv.googlecode.com/svn/trunk/html5.js”&gt;&lt;/script&gt;<br />
&lt;![endif]–&gt;<br />
[/js]</p>
<p><strong>Apply CSS to Elements</strong></p>
<p>Since we can apply styles to our normal HTML4 elements, we can apply styles to our new semantic elements too.</p>
<p><strong>Example:</strong><br />
[html]<br />
footer{border:1px solid;}<br />
[/html]</p>
<p>The preceding style will be applied to all the footers available in a page.</p>
<p><strong>NB:</strong> Please be noted that it is not recommended (Footer, FOOTER) to use upper-case in the elements.</p>
<p><strong>Introduction to Canvas Element</strong></p>
<p>If you want to create some graphic content, the Canvas element is the right choice.</p>
<p>Let us see how to use it.</p>
<p><strong>Declaring the Canvas</strong><br />
[html]<br />
&lt;canvas id=“canvasExample” width=“200” height=“100”<br />
style=“border:1px solid #ccc;”&gt;<br />
Bad Luck, It seems your browser won’t support 🙁<br />
&lt;/canvas&gt;<br />
[/html]</p>
<p><strong>Implementing Canvas</strong><br />
[js]<br />
var c = document.getElementById(“canvasExample”); //Get the element<br />
var ctx = c.getContext(“2d”); // Get the context for the element<br />
var grd = ctx.createLinearGradient(0, 0, 200, 0); //Create the line<br />
grd.addColorStop(0, “blue”); // Apply the colors<br />
grd.addColorStop(1, “white”); // Apply the colors<br />
ctx.fillStyle = grd; //apply the style<br />
ctx.fillRect(10, 10, 150, 80); // Fill<br />
[/js]</p>
<p>Here we are applying the gradient to the canvasExample canvas.</p>
<p><strong>Introduction to SVG</strong></p>
<p>Scalable Vector Graphics is for implementing graphics for the web as canvas. One of the differences between canvas and SVG is that SVG supports event handlers but canvases don&#8217;t. We will discuss that later.</p>
<p><strong>Declaring SVG</strong><br />
[html]<br />
&lt;canvas id=“canvasExample” width=“200” height=“100”<br />
style=“border:1px solid #ccc;”&gt;<br />
Bad Luck, It seems your browser won’t support 🙁<br />
&lt;/canvas&gt;<br />
[/html]</p>
<p>See the complete HTML here<br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
    &lt;table style=“border:1px solid #ccc;”&gt;<br />
        &lt;tr style=“border:1px solid #ccc;”&gt;<br />
            &lt;td style=“border:1px solid #ccc;”&gt;<br />
                &lt;h2 style=“text-align:center;”&gt;Canvas&lt;/h2&gt;<br />
                &lt;canvas id=“canvasExample” width=“200” height=“100”<br />
                        style=“border:1px solid #ccc;”&gt;<br />
                    Bad Luck, It seems your browser won’t support 🙁<br />
                &lt;/canvas&gt;<br />
            &lt;/td&gt;<br />
            &lt;td style=“border:1px solid #ccc;”&gt;<br />
                &lt;h2 style=“text-align:center;”&gt;SVG&lt;/h2&gt;<br />
                &lt;svg width=“200” height=“200”&gt;<br />
                    &lt;circle cx=“100” cy=“100” r=“50”<br />
                            stroke=“green” stroke-width=“4” fill=“yellow” /&gt;<br />
                    Bad Luck, It seems your browser won’t support 🙁<br />
                &lt;/svg&gt;<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
    &lt;script&gt;<br />
        var c = document.getElementById(“canvasExample”); //Get the element<br />
        var cctx = c.getContext(“2d”); // Get the context for the element<br />
        var grd = ctx.createLinearGradient(0, 0, 200, 0); //Create the line<br />
        grd.addColorStop(0, “blue”); // Apply the colors<br />
        grd.addColorStop(1, “white”); // Apply the colors<br />
        ctx.fillStyle = grd; //apply the style<br />
        ctx.fillRect(10, 10, 150, 80); // Fill<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>I hope you have tried this. See you soon with another set of elements in the next article.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/html-5-elements-in-a-look-part-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
