<?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>JavaScript &#8211; TUTORIALS PAGE</title>
	<atom:link href="https://tutorialspage.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>https://tutorialspage.com</link>
	<description>Free tutorials and daily notes</description>
	<lastBuildDate>Sun, 08 Oct 2023 21:21:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">105742871</site>	<item>
		<title>PrettyPhoto Minimal Theme &#8211; a pure CSS prettyPhoto simple theme</title>
		<link>https://tutorialspage.com/pretty-photo-minimal-theme-a-pure-css-prettyphoto-simple-theme/</link>
					<comments>https://tutorialspage.com/pretty-photo-minimal-theme-a-pure-css-prettyphoto-simple-theme/#respond</comments>
		
		<dc:creator><![CDATA[cata]]></dc:creator>
		<pubDate>Thu, 10 Mar 2016 13:59:38 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">http://tutorialspage.com/?p=1250</guid>

					<description><![CDATA[I have recently used prettyPhoto for a project and I have to admit that it is a great tool to have in hand when it comes to modal pop-ups. It has lots of types of content support and it is really simple to customize. prettyPhoto also comes with lots of features and 5 built-in themes&#8230; light_rounded dark_rounded &#8230; <a href="https://tutorialspage.com/pretty-photo-minimal-theme-a-pure-css-prettyphoto-simple-theme/" class="more-link">Continue reading<span class="screen-reader-text"> "PrettyPhoto Minimal Theme &#8211; a pure CSS prettyPhoto simple theme"</span></a>]]></description>
										<content:encoded><![CDATA[<p>I have recently used prettyPhoto for a project and I have to admit that it is a great tool to have in hand when it comes to modal pop-ups.</p>
<p>It has lots of types of content support and it is really simple to customize. <strong>prettyPhoto </strong>also comes with lots of features and 5 built-in <strong>themes</strong>&#8230;</p>
<ul>
<li>light_rounded</li>
<li>dark_rounded</li>
<li>light_square</li>
<li>dark_square</li>
<li>facebook</li>
<li>pp_default</li>
<li>minimal theme &#8211; <span style="color: #808080;">which will add here with <strong>minimal and pure CSS</strong></span></li>
</ul>
<p>&#8230;which you can easily change via JavaScript customization. But this is not the subject of this tutorial.</p>
<p>I prefer a default <strong>minimal and simple theme for prettyPhoto</strong> and the ability to add stuff if I need it and not the opposite. So this is my little CSS to create a <strong>simple theme for prettyPhoto</strong><span id="more-1250"></span></p>
<p>Please note that this theme is beta version and you should check that everything is OK before any production deployment. You can also remove all other themes if you do not need them, for a light weight code.</p>
<h2>What you will download with the Minimal prettyPhoto theme</h2>
<p>So with theme you will get the following:</p>
<ul>
<li>Minimal theme for prettyPhoto lightbox</li>
<li>Really simple and minimal aspect</li>
<li>No images have been used and I mean no images, including no sprites and no encoded images in the CSS.</li>
<li>1 and only HTTP requests to load the theme CSS file (like I said, no images are used). The default theme uses 22 requests to 7 image files of about 20KB (all).</li>
<li>Smaller CSS file size only 5KB for the compressed version.</li>
</ul>
<blockquote><p>so this is all about speed, after all.</p></blockquote>
<p>So all this, smaller file size and less HTTP requests translate into faster speed when talking about page loading.</p>
<p>Note, that you can bundle this theme into the prettyPhoto main CSS files and remove all other themes if you do not need them.</p>
<p>But if you don&#8217;t insert the theme into the main CSS you will still have a fast loading theme, since the browser will not load images in the CSS that are not used. I will not blame you if you don&#8217;t bundle the files together, I also prefer to keep things separate, just in case you need to update.</p>
<p>You can include the theme in a separate CSS file like this</p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" /&gt;
&lt;link rel="stylesheet" href="css/prettyPhoto.minimal.css" type="text/css" /&gt;</pre><p>You can include it in any order. It will work.</p>
<p>This is all you have to do to have your minimal theme for prettyPhoto available. You can now go and activate it via prettyPhoto standard function:</p><pre class="urvanov-syntax-highlighter-plain-tag">$(document).ready(function(){
    $(".gallery a[rel^='prettyPhoto']").prettyPhoto({
        theme:'minimal'
    });
});</pre><p>Scrool a little bit to see a live working version of the prettyPhoto minimal theme and download the CSS files from GitHub.</p>
<h3>PrettyPhoto Minimal theme Demo</h3>
<p class='codepen'  data-height='533' data-theme-id='0' data-slug-hash='grMpGr' data-default-tab='result' data-animations='run' data-editable='' data-embed-version='2' data-preview='true'>
</p>

<h3>Download Minimal theme for prettyPhoto lightbox</h3>
<p>You can find the minimal prettyPhoto theme on GitHub here:</p>
<p><a href="https://gist.github.com/catalin586/12ff5f68ceaba74e9c3d">https://gist.github.com/catalin586/12ff5f68ceaba74e9c3d</a></p>
<h3>Credits &#8211; Here is what I have used for the Minimal theme</h3>
<p>The SpinKit to create a simple CSS loader instead of calling a gif image:  <a href="https://github.com/tobiasahlin/SpinKit">https://github.com/tobiasahlin/SpinKit</a></p>
<p>Some pure CSS icons. I use it for the expand/contract buttons. It works well on IE also. <a href="http://nicolasgallagher.com/pure-css-gui-icons/">http://nicolasgallagher.com/pure-css-gui-icons/</a></p>
<p>Some styling for small screens. It&#8217;s not perfect but it&#8217;s the best I could came up with. <a href="http://themeforest.net/forums/thread/prettyphoto-styling-for-small-screens/66783">http://themeforest.net/forums/thread/prettyphoto-styling-for-small-screens/66783</a></p>
<p>And the prettyPholo lightbox that you can download it from the main site here: <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialspage.com/pretty-photo-minimal-theme-a-pure-css-prettyphoto-simple-theme/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1250</post-id>	</item>
		<item>
		<title>Simple &#8220;time to stop working&#8221; jQuery counter with alert</title>
		<link>https://tutorialspage.com/simple-time-to-stop-working-jquery-counter-with-alert/</link>
					<comments>https://tutorialspage.com/simple-time-to-stop-working-jquery-counter-with-alert/#respond</comments>
		
		<dc:creator><![CDATA[cata]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 08:33:17 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://tutorialspage.com/?p=920</guid>

					<description><![CDATA[I am sure there are tons of countdowns out there, but I think none was built for this special purpose. I was playing with the jquery counter and just came to me: I want an alert to remind me to stop working and tell me to go home when it&#8217;s time. Yes, of course I could &#8230; <a href="https://tutorialspage.com/simple-time-to-stop-working-jquery-counter-with-alert/" class="more-link">Continue reading<span class="screen-reader-text"> "Simple &#8220;time to stop working&#8221; jQuery counter with alert"</span></a>]]></description>
										<content:encoded><![CDATA[<p>I am sure there are tons of countdowns out there, but I think none was built for this special purpose. I was playing with the jquery counter and just came to me: I want an alert to remind me to stop working and tell me to go home when it&#8217;s time.</p>
<p>Yes, of course I could just use the phone alert&#8230;but this is funnier&#8230;and I can say &#8220;I made this&#8221; <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The good part, is that you can pin the tab in your favorite browser (I am a Chrome evangelist) and every time you start it, it also starts the timer. The counter restarts automatically every day, so you don&#8217;t have to worry about it and it shows the alert no matter what you are doing when time finishes.</p>
<p>I customized so it pup ups the alert every day at 5:30pm exempt on Friday when it shows me the alert al 2:30pm. Feel free to do it your way.</p>
<p><span id="more-920"></span></p>
<p>This counter was actually used on a website to let the user know client-side, the time has left to complete an online exam. I have then converted it into a funnier counter. Hope you like it.</p>
<p>I use a local installation of XAMPP and give it a special website where to run, but there is really no need for all this trouble. You can run this from any place like your normal server or even from your desktop. It is just pure html with two lines of javascript included.</p>
<h2>The counter with alert snippet</h2>
<p>Here is the main snipped that does all the job. Also don&#8217;t forget to include the jQuery library.</p><pre class="urvanov-syntax-highlighter-plain-tag">var d = new Date();

    var month   = d.getMonth()+1;
    var day     = d.getDate();
    var year    = d.getFullYear();

    var day_in_week = d.getDay();

    var hour    = (day_in_week == 5 ? 14-1 : 17-1);
    var minute  = 30;
    var second  = 00;

    var s1      = '/';
    var s2      = ':';

    var output  = month+s1+day+s1+year+ ' ' +hour+s2+minute+s2+second;

    $('#myCounter').countdown({

        date: output

    }, function () {

        alert('Go home now...you must be very tired!');

    });</pre><p>&nbsp;</p>
<p>You can see a <strong>demo file on <a href="https://gist.github.com/catalin586/f514a5e51aa3a9e27679">Github</a></strong>. And you must <strong>download the main <a href="https://github.com/catalin586/countdown">jquery.countdown.min.js</a></strong> from the @eka7a repository. YOu also have there a small demo and some documentation, but for a more generic purpose.</p>
<p><img data-recalc-dims="1" fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1145" src="https://i0.wp.com/tutorialspage.com/wp-content/uploads/2016/02/simple-jquery-counter.png?resize=622%2C210&#038;ssl=1" alt="simple-jquery-counter" width="622" height="210" srcset="https://i0.wp.com/tutorialspage.com/wp-content/uploads/2016/02/simple-jquery-counter.png?w=622&amp;ssl=1 622w, https://i0.wp.com/tutorialspage.com/wp-content/uploads/2016/02/simple-jquery-counter.png?resize=300%2C101&amp;ssl=1 300w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></p>
<p>Feel free to edit and set up for you needs. You can let me know if you find other curious ways to use it.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialspage.com/simple-time-to-stop-working-jquery-counter-with-alert/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">920</post-id>	</item>
	</channel>
</rss>
