Created
July 11, 2012 18:06
-
-
Save quangbahoa/3092080 to your computer and use it in GitHub Desktop.
Noty forst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/noty/jquery.noty.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I'm an example text. When I grow up I want to be a noty message by Default","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/noty/jquery.noty.js"></script> | |
<?php | |
if ( is_front_page() ) { /* // Noty hiển thị tại HOME */ | |
echo ' | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I\'m an example text. When I grow up I want to be a noty message on HOME","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script>'; | |
} elseif ( is_category() ) { /* // Noty hiển thị tại CATEGORY */ | |
echo ' | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I\'m an example text. When I grow up I want to be a noty message on CATEOGRY","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script>'; | |
} elseif ( is_page('Sample Page') ) { /* // Noty hiển thị tại trang Sample Page */ | |
echo ' | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I\'m an example text. When I grow up I want to be a noty message by Sample Page","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script>'; | |
} elseif ( is_date() ) { /* // Noty hiển thị tại DATE Artchive */ | |
echo ' | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I\'m an example text. When I grow up I want to be a noty message by Sample DATE","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script>'; | |
} | |
else { /* // Noty hiển thị tại mọi nơi ngoài nhưng nơi trên */ | |
echo ' | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
noty({"text":"Hi! I\'m an example text. When I grow up I want to be a noty message by Default","layout":"top","theme":"noty_theme_default","type":"information","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":false,"closeButton":true,"closeOnSelfClick":true,"closeOnSelfOver":false,"modal":false}); | |
}); | |
</script>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment