Step One:

Copy the following code and paste it into the head of your page.

<script type="text/javascript" src=""></script>
<script type="text/javascript" src="mobiopt/mobiopt.js"></script>

If you are using WordPress, or have a common header, just paste that line in your “header.php” file. It don’t really matter in what file you put that string.

- Tech Note –
I am using Google to host the jquery library. If you do not want to use Google you will need to download the jQuery library and upload it to your server next to “mobiopt/mobiopt.js” and edit the line above to reflect the location of your jQuery library!

This concludes step one!

Optional Test/customizing:

During the testing and customizing process we can REVERSE this script so that our computer browsers will “trip the flag” and cause the box to popup.

Just up an exclamation (!) point in front of the first “if” variable. Take a look at the red exclamation point in the segment of code below

if ( ! ) { 


This concludes step two!

Customization is pretty strait forward and easy. Just remember that mobi browsers render a bit different than computer browsers!

The red colored words are what can be customized!

Link to mobile website

mobiopt_site = ‘mobi.html‘;

Cookie Duration in seconds

mobiopt_time = ‘3600‘; //3600 = 1 hour

Option box background image

mobiopt_bgnd = ‘blue.png‘;

option box text color

mobiopt_colr = ‘#444‘;

option box text

mobiopt_text = ‘It appears you are on a mobile device.<br />Would you like to go to our mobi site?‘;

options box “go” button

mobiopt_btgo = ‘Go To Mobi‘;

options box “stay” button

mobiopt_stay = ‘Stay Here‘;

orange bar text

mobiopt_bart = ‘Take to me your mobile site‘;

orange bar link text

mobiopt_barl = ‘Go To Mobi‘;

I’ve used the following plugins.

Once again, thank you so much for purchasing this script. As I said at the beginning, I’d be glad to help you if you have any questions relating to this script. No guarantees, but I’ll do my best to assist. If you have a more general question relating to the scripts on CodeCanyon, you might consider visiting the forums and asking your question in the “Item Discussion” section.