Turn off the lights with jQuery
For those who enjoy watching videos on the internet, this is a very useful script made with jQuery by Janko. And what this script does? It will turn off the lights for you, so that everything on the page will be fading to dark, except the video, and everything around the video will be less visible, in a way that nothing will distract you while watching it.
You can test it on the following demo blog - click the link that says "Turn off the lights" and the page will be darkened. To make the page elements active again, just click the "Turn on the lights" link:
How to add the "Turn off the Lights" Feature to Blogger/Blogspot
Step 1. Log in to your Blogger account and click on your blog > go to "Template" and hit the "Edit HTML" buttonStep 2. Click anywhere inside the code area and search for the following tag by pressing the CTRL + F keys (hit Enter to find it)
Step 3. After you found it, paste the below scripts just above it:
Note: if you already have one version of jquery in the template, please remove the line in red.
Step 4. Now search for the following tag:
]]>Step 5. Just above ]]> add the following CSS:
/* Turn off the lightsStep 6. Try to find this tag:
----------------------------------------------- */
#lightsVideo {
position:relative;
z-index:102;
}
#switch {
max-width:640px;
text-align:left;
position:relative;
height:25px;
display:block;
}
.lightSwitcher {
position:absolute;
z-index:101;
background-image:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_r1QlC_4KNVXt2E1JY-YZR4Rt-M4c9295hNgV3mzkDo-1eUPjB4koowOoF8-wx_kZH08BW_NarTmy5mD4Jlm9kUBd4o0q1gl9B43e9I1BjWuefupXiBR6f8ojAYny0LssAyT27Ltaf30C/s1600/lights-on.png);
background-repeat:no-repeat;
background-position:left;
padding: 0 0 0 20px;
outline:none;
text-decoration:none;
}
.lightSwitcher:hover {text-decoration:underline;}
.turnedOff {
color:#ffff00 !important;
background-image:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR57hfKAq1XTq1S6ocnmBNYcjUSpkJ-s7s3yKze7m8i01xM2Y5c7hAngIDoLFM27-s9mYasGPJz9goh1d1ATibvbwVW5k5q56xBxrKOfTgavo2K88wJdej5Dgbj8lYI0FoM42nLQ7kBWgf/s1600/lights-off.png);
}
#lightsoff {
background:#000;
opacity:0.9;
filter:alpha(opacity=90);
position:absolute;
left:0;
top:0;
width:100%;
z-index:100;
}
0 commentaires:
Enregistrer un commentaire
Abonnement Publier les commentaires [Atom]
<< Accueil