Open Links in a New Tab on Right Click Disabled Sites

Disabling right click on websites and blogs are not a common thing among bloggers who don't want their sites content to be copied.
Disabling right click is quite useful (but it doesn't completely stops a user from copying the content) but for the visitors it can be annoying and a very bad experience exploring a site with right click disabled.

One of the biggest problem is opening a link in a new tab. If you have a mouse with a three buttons (check if your scroll button is clickable) you can open any link by clicking on it using the middle button but if you don't have such mouse then might probably get mad and perhaps punch your monitor screen too !

But if you are here then you considered to Google a solution for this instead of damaging your PC.
   

Opening a link in new tab

Could have been easier if you had a mouse with three buttons but don't worry, I won't make you spend money just to open links in a new tab.

The easy way is to use CTRL + Left Mouse Button (LMB) and for Mac CMD + LMB (not sure - I don't have a Mac). It should now open the link in a new tab.

But if you have a mobile device then god bless you :( but don't lose hope, Google again for a solution for mobile devices.

Update: I am soon going to launch a Chrome extension that will make links on a site to open automatically in new tab on click.

For Website/Blog Owners

If you have a blog or website with right click disabled then you might place a notification box that should tell the readers what to do to open a link in a new tab.

But the better way is to add the target='_blank' attribute to your  external anchor element so it opens in a new tab by default.

And if possible, don't add any alert message on right click. Disabling right click is okay but to show an alert irritates. Check Disable Right Click Without Using JavaScript even this tutorial uses JS but not a big JS function and the best thing is that it doesn't send out any alert message to scare the right-clickers (who aren't always content copiers) but I always say that it's impossible to stop the bad-a*s content copiers to copy your content so always be ready to use the Removing Content from Google form and the best part is that human will respond to your reports!

Auto Hide Notification Box in Blogger

Notification boxes in blogs can be useful for notifying readers about something hot on your blog. But this notification box is a bit different from others, it hides automatically after a specified time.
You may find lots of tutorials about these types of notification boxes but this one is different. It hides itself after a specified time which is the best thing about this. It won't remain there on the page forever (which can possibly disturb the reader not interested in notifications).

Before we proceed to the tutorial check what you are going to add to your blog. 
Demo

Proceed to the tutorial to know how to add it to your blog.

The HTML


The first thing we need is the HTML code as always. The code is simple and you can edit its content easily to make it ready for your blog. This is the HTML snippet

<div id='float-bar' style='display:none;'>
<b class='notifyTextbld'>Notification:</b>
Hello! Welcome to our blog and blah blah blah. See this new post <a rel='nofollow' href='http://stramaxon.com'>Cookies!</a>
</div>
The box contains bold text "Notification" and below it is some message you want your readers to see. You may also include an anchor link to a post or website you want the readers to visit.

Edit the HTML

You will need to edit the text (on line number 3) to display your own message. You know how to do it, just replace the sample text with your own meaningful message. It also contains an anchor link :

<a rel='nofollow' href='http://stramaxon.com'>Cookies!</a>
If you want your readers to visit a page then you can add your own HTML anchor links or any element, you can even add images inside it.

If you are not familiar with HTML but want to add different HTML elements use the Blogger post editor to set the elements in a graphical user interface, switch to the HTML tab, copy the HTML and paste it in the third line of the HTML.

Add the HTML

To add this HTML you have to edit your template HTML so it's good to backup your current template.

We can add this HTML anywhere in the template (inside body element) but to make sure it doesn't interfere with any other element in the template it is best to add it below everything. Follow this steps to do that :
  1. Go to your Blogger Dashboard
  2. Click on the Template tab
  3. Press the Edit HTML button, ignore the warning and proceed. 
  4. Now open the in-page search function in your browser (default CTRL+F)
  5. And search for </body> 
  6. When you find it, paste the HTML code just above it and save the template. 
Once done, check your blog for the HTML (it might be at the bottom), it may look dull, to make it beautiful we will need the CSS. So proceed to the next step.

The CSS

Yeah, this is what gives life to dead HTML skeleton.  The following CSS will be used to style the notification box.
#float-bar {
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Helvetica, Arial, sans-serif;
background-color:rgba(248, 248, 248, 0.85);
color:#000;
padding:10px 30px 30px 30px;
font-size:16px;
position:fixed;
right:10px;
top:0px;
width:500px;
border-radius:0px 0px 10px 10px;
z-index:99999;
}

#float-bar a {color:#000;}
#float-bar a:hover {color:#000;text-decoration:none;}

#float-bar .notifyTextbld {display:block;margin-bottom:20px;}

Editing the CSS

You might want to modify the codes. Edit the values in the highlighted lines.
  • Line 3: This the background color of the box. Replace the value with a rgba color value (with alpha transparency) or HEX color code. 
  • Line 4: This is the color of the text inside the notification box. Use HTML Color Picker to choose a HEX color code  
  • Line 6: This is the size of font inside the notification box. Change the 16px to a desired value.
  • Line 8: You can edit both the property name and its value. Change right to left if you want the notification bar to appear on the left side. And also you can change the 10px to a some other value, this decides how far the box should be from the position. 
  • Line 9: The number of pixels you can the box to be far from the top. 
  • Line 10: This is the width of the box. Change the pixel value if you want.
If you know about CSS (it's easy) you may try adding for removing properties to design your own different box.

Adding the CSS

Check this tutorial to learn how to add CSS in Blogger
http://stramaxon.blogspot.com/2012/03/how-to-add-css-to-your-blogger-blog.html

The JavaScript jQuery 

The final step is to add the JavaScript jQuery script. The script controls how the box should enter and exit. We can do a lot of things with it but for now we will just do the basic in and out stuff.

Including jQuery Library

If you already have jQuery library installed then skip this step. If not then copy the HTML line below :
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
To add this in your template : Go to your Blogger Dashboard -> Template -> Edit HTML -> Search for </head> and paste the code just above </head> and save the template.

Now you may proceed to the next step.

The jQuery Script

This is the script you need.
<script type='text/javascript'>
$(document).ready(function(){
$('#float-bar').slideToggle(445,function(){
$(this).show(function(){
setTimeout(function (){
$('#float-bar').slideUp(445);
},5000);
});
});
});
</script>
You don't need to change anything in this script expect the number of seconds you want the notification bar to stay on the page.

The line number 7 contains a number value 5000 which is the number of milisecond after which the box will disappear. 1000ms = 1sec, so just change the value to set a different time for it to hide. If you want the box to stay on the page for 20 seconds you may change the value to 20000

Adding the Script

The procedure to add the script is same as adding the HTML in the body. To add it go to your Blogger Dashboard -> Template -> Edit HTML -> Use CTRL+F and find </body> in the template and then paste the jQuery code just above </body>.

Showing it just on Homepage

You might not want this notification bar everywhere so the question how do you set it to just display on homepage, post pages, or an index page and archive pages.

The best way to do this is to use Blogger conditional tag (which works on the backend) which will make the box render only on the page type you specify.

The code we will need is this
<b:if cond='data:blog.url == data:blog.homepageUrl'>
//The HTML/JS/CSS or any code you want.
</b:if>
Replace the 2nd line in this code with the HTML code of the notification box and then add it to your template as instructed in in the tutorial. All we did is added the <b:if> conditional tag around the HTML code provided in the tutorial.

Now check your blog for the new notification bar. How is it ? I hope you liked it but if you found any error in the code then do post it in the comments. Thanks.

Fighting MALICIOUS_JAVASCRIPT Notice in Blogger

There have been many cases where a user's blog got deleted because of Malicious Javascript. It's frustrating to get your blog deleted but it's just down for a review. Read why it happens and how to prevent it.
Blogger is one of the most popular CMS and the as it's free, spammers love to target their victims using Blogger blogs. Spreading malicious software and viruses has become easy for spammers and thus blogger blogs are becoming a weapon for those evil spam spreaders. The Blogger platform was already secure as it doesn't allow the user to access server side configurations but yet the spammers can use JavaScript to trick their victim and infect their system with malware etc.

Keeping all these things in mind, blogger created a better spam detection system checks blogs for JavaScripts which redirects or does any other weird tasks and take down the site for safety of the readers.

I am not a spammer! Why my blog got deleted?

The spam detection system scans the blog for any suspicious scripts which can be a possible threat and then takes it down as I already said. It doesn't have anything to do with your profile.

Usually spammers add JavaScript that does a redirect to a site or link to a virus, which infects your system and can do anything the virus creator wants it to do. But recently many normal blogger users' blog were taken down for MALICIOUS_JAVASCRIPT as many users use scripts and codes from external site without knowing what exactly it does. For example, when blogger introduced country specific redirection and a blog posted a script that stopped country specific redirection (which actually redirects the blog URL adding /ncr at the end). Here's the snippet of code used :
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf("."));
if (ctld != ".com") {
var ncr = "http://" + blog.substr(0, blog.indexOf("."));
ncr += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}

The blog that published this article is quite popular and many blogger users used this code to stop country specific redirection. This is an example of scripts which can get blog deleted.

How do I restore my Blog?

Blogger spam detection and review system has got better. It now provides option for users to submit their blog for spam review.

If you see a notice for your blog that indicates that your blog has been removed, you can now take action to restore it. Blogs deleted by spam detection system now will appear in the Deleted Blogs section in the Dashboard.

Log into your Blogger Dashboard -> and click on Deleted blogs on the left hand side

All your deleted blogs will be on that page, and the blogs deleted for spam and malicious javascript there will be a Restore button next to the blog name. It will send the blog for review to Google/Blogger Spam experts. You will get the reply within 48 hours.

Now beware of of JavaScript codes on the internet, not all of them are spam but before adding them check what people are discussing about it, is it okay to use or has any problem. 

Header Animating Entrance Effect for Blogger

Not only for blogger but every one using HTML and web languages to display their blog or website. This is a small animating effect created using CSS3 to give an exclusive look to your website.
The new CSS transform and animation can create awesome effect if used the correct way. And being a web designer who is still learning I get to learn about new techniques everyday but I don't always share it on my blog for blogger users who are not experts in using these technologies. I decided to post at least one add-on effect for blogger users every week and this is the first one.

In this tutorial I will tell you how to make an animated entrance effect for the blog's title heading in blogger (can be used on any site by using the correct selectors). Here's the demo and file download link.
Preview Download File

To add this to blogger follow these instruction below

Adding the CSS

In most of our tutorials we first add HTML and then the CSS, but here will add the style code before editing the HTML. The CSS we need to create this entrance effect, is a long code, but don't worry, it won't slow down your site.

Here's the code we are going to use :
/* Animation Effect - Credit goes to Dan Eden @_dte */
@-webkit-keyframes flipInY {
0% {
-webkit-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-webkit-transform: perspective(400px) rotateY(-30deg);
}

70% {
-webkit-transform: perspective(400px) rotateY(10deg);
}

100% {
-webkit-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@-moz-keyframes flipInY {
0% {
-moz-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-moz-transform: perspective(400px) rotateY(-30deg);
}

70% {
-moz-transform: perspective(400px) rotateY(10deg);
}

100% {
-moz-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@-o-keyframes flipInY {
0% {
-o-transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
-o-transform: perspective(400px) rotateY(-30deg);
}

70% {
-o-transform: perspective(400px) rotateY(10deg);
}

100% {
-o-transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}
@keyframes flipInY {
0% {
transform: perspective(400px) rotateY(90deg);
opacity: 0;
}

40% {
transform: perspective(400px) rotateY(-30deg);
}

70% {
transform: perspective(400px) rotateY(10deg);
}

100% {
transform: perspective(400px) rotateY(0deg);
opacity: 1;
}
}

.flipInY {
-webkit-backface-visibility: visible !important;
-webkit-animation-name: flipInY;
-moz-backface-visibility: visible !important;
-moz-animation-name: flipInY;
-o-backface-visibility: visible !important;
-o-animation-name: flipInY;
backface-visibility: visible !important;
animation-name: flipInY;
}

.animated {
-webkit-animation-duration: 1.4s;
-moz-animation-duration: 1.4s;
-o-animation-duration: 1.4s;
animation-duration: 1.4s;
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
-o-animation-fill-mode: both;
animation-fill-mode: both;
}

You know how to add this CSS in your blogger blog. Or if you don't know, then this post will help you http://www.stramaxon.com/2012/03/how-to-add-css-to-your-blogger-blog.html

Thanks to Dan Eden for creating such good effects with CSS animation and transform, Here are some more animation effect on his site http://daneden.me/animate/

The first step in order to add this effect is complete, now you need to do some HTML edits to make it work. See the next step.

Editing the HTML

To animate the entrance of your blog's title heading, we have to edit its HTML in the template. To do that go to your Blog Dashboard -> Template -> Edit HTML -> Check mark Expand Widget Template -> Now use CTRL+F to find the following code
<h1 class='title' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>

The code on your template might look different if you have enable background images or other settings, but the code will always contain the b:include wrapped inside it. Find it using the first few letters of the code you will find it.

Now change add animated flipInY in the class attribute of the heading element <h1 class='title' the code should look like this (notice the first line)
<h1 class='title animated flipInY' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>
Note: The HTML code is two times in the template, you have to edit both codes.

Not only blog's header but you can do this for any element on your blog page just by adding animated flipInY as class name to the element.

Tell us how did you like this effect in the comments. 

Hover Effect Button using CSS3

I have been using this hover button on my blog for Demo links. Some of the readers on this blog requested me write a tutorial on making something like this. So, here's the tutorial!
If you don't know what button I am talking about then this is what you are going to make after reading this tutorial :
Hey! Hover me to see the effect

How is it? Lovely, isn't it? If you are a Gmail user then you probably know where this design came from, yup this design is from the Gmail's loading bar. I created the design for buttons when my internet was super slow, I had nothing else to do rather then watching the Gmail's loading bar, so I opened up my developer tools and the notepad, wrote all the CSS properties and next I gave it a hover effect to make it look good and it was ready.

You can also make buttons like this on your blog or website using some small lines of CSS and HTML. Read the following steps to add the button to your site :

The CSS for button

We first need to apply a CSS rule for the buttons to give it style. This is the CSS you need to add to your site :
.mjButton {
color:white !important;
background-color: #6188F5;
text-decoration:none !important;
background-image: -webkit-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -moz-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -o-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
background-image: -ms-linear-gradient(315deg,transparent,transparent 33%,rgba(0, 0, 0, 0.12) 33%,rgba(0, 0, 0, 0.12) 66%,transparent 66%,transparent);
margin:4px;
padding:8px;
text-transform:uppercase;
text-decoration:none;
border:1px solid gainsboro;
text-shadow:1px 1px grey;
font-weight:bold;
font-size:11px;
background-position: 21px 37px;
background-size: 65px 45px;
-webkit-transition:all 0.7s ease-in-out;
-moz-transition:all 0.7s ease-in-out;
-ms-transition:all 0.7s ease-in-out;
-o-transition:all 0.7s ease-in-out;
transition:all 0.7s ease-in-out;
}

/* Mouseover State */
.mjButton:hover {
background-position: 21px 37px;
background-size: 999px 45px;
}

Just include this CSS style rule in your stylesheet and the first step is done. If you are using blogger then check this guide on Adding CSS To Your Blogger Blog

The HTML for buttons

After adding the CSS code in your site or blog the next step to create the button on your web pages is to add the HTML. This is the HTML for the button :
<a href="#" class="mjButton">hey! click this</a>
Yup the button is an anchor element so you can easily put URL in it to link to pages. If you change the value of class attribute in the <a> element, you also have to change the selectors in CSS to match it with the class of the HTML element.

Adding this HTML line in your webpage should now render a hover effect button just like on my site. If you found any problem, please post it as a comment. 

Note: The button is using CSS3 gradients to create this effect and it's a new technology so it wouldn't work the same on all browsers.