Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Run the scripts
- $(document).ready(function(){
- mgFormFieldHighlight();
- mgPageAdminAmination();
- initLightbox();
- initSuperfish();
- $('.required label,.optional label').mgToolTipIcons();
- mgToolTipsHover();
- $.mask.masks : {
- .'JaseMask' : { mask : '9999 9999 9999 9999' }
- };
- });
- // JQuery Superfish Dropdowns
- function initSuperfish(){
- $("ul.nav").superfish();
- };
- // JQuery Lightbox
- function initLightbox(){
- $('a[@rel*=lightbox]').lightBox();
- };
- // Mongoose JQuery Page Admin Animation
- function mgPageAdminAmination(){
- $(".page_admin_panel").prepend("<a href='' class='toggle_page_admin'>Page Admin</a>");
- $(".toggle_page_admin").click(function(event){
- $(".page_details").slideToggle('fast');
- // Stop the link click from doing its normal thing
- return false;
- });
- };
- // Mongoose JQuery Form Field Highlighting
- function mgFormFieldHighlight(){
- $('.required *,.optional *,.required_float *').focus(function(){
- $(this).parent().addClass('highlight');
- });
- $('.required *,.optional *,.required_float *').blur(function(){
- $(this).parent().removeClass('highlight');
- });
- };
- // Mongoose JQuery Tooltips
- // First create Tool Tip Icons based off the Label Titles
- $.fn.mgToolTipIcons = function(){
- return this.each(function(){
- var label = $(this);
- var titleText = label.attr('title');
- if (titleText) {
- label.prepend(' <span class="mgToolTipIcon">' + titleText + '</span>');
- label.removeAttr('title');
- }
- });
- };
- // Then attach hover events to the Tool Tip Icons
- function mgToolTipsHover() {
- $('.mgToolTipIcon').hover(
- function() {
- var tooltipText = $(this).text();
- $(this).append('<div class="mgToolTip">' + tooltipText + '</div>');
- $('.mgToolTip').fadeIn(300);
- },
- function() {
- $('.mgToolTip').fadeOut(300);
- $(this).children().remove();
- }
- );
- };
Add Comment
Please, Sign In to add comment