This file contains hidden or 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
| //expects the following values to be set: | |
| // flyout menu: "#fixedOptions" | |
| // expects an image to be the first li in the menu | |
| // default css should have it margin-right to ($('#fixedOptions').width()- $('#fixedOptions li:eq(0)').width() ) | |
| function createFlyout() { | |
| //set some vars to work with | |
| var fly = $('#fixedOptions'); | |
| var icon = $('#fixedOptions img'); | |
| var iWidth = $('#fixedOptions img').width(); |
This file contains hidden or 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
| //usage: returns IE version else -1 | |
| function getInternetExplorerVersion() | |
| // Returns the version of Internet Explorer or a -1 | |
| // (indicating the use of another browser). | |
| { | |
| rv = -1; // Return value assumes failure. | |
| if (navigator.appName == 'Microsoft Internet Explorer') | |
| { | |
| var ua = navigator.userAgent; | |
| var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); |
This file contains hidden or 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
| jQuery.fn.loadComplete = function (fn) { return this.each(function () { if (this.complete || this.readyState == 'complete') { fn.call(this); } else { $(this).load(fn); } }); }; $('img').loadComplete(function(){ $(this).fadeIn(800); }); //don't forget to initially hide them! |
This file contains hidden or 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
| function modal() { var html = "./path/to/modalFile.html"; var div= $('a#modal'); //the empty container div in your doc for the modal dialog feedback.click(function() { $('#modDisplay').dialog({position: {my: 'right top', at:'center center', of: window}}).load(html); return false; //prevent the page from navigating }); } |
This file contains hidden or 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
| // Code Block used displaying color code on passwords. | |
| function PasswordValidator() { | |
| $(document).ready(function() { | |
| $('#m2_MB_txt_UserPass2').hide(); | |
| $("#m2_MB_txt_UserPass1").keyup(function(event) { | |
| var textBox = document.getElementById("m2_MB_txt_UserPass1"); | |
| var count = textBox.value.length; | |
| if (count > 5) { | |
| $('#m2_MB_txt_UserPass2').show(); |
This file contains hidden or 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
| //does something when the DOM is ready to be traversed | |
| $(function() { | |
| //code here | |
| })(); | |
| //does something when everything is completely loaded | |
| $(window).load(function(){ | |
| //code here | |
| }) |
This file contains hidden or 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
| var id; | |
| $(window).resize(function() { | |
| clearTimeout(id); | |
| id = setTimeout(function() { | |
| if($(window).innerHeight() < 700 || $(window).innerWidth < 900) { | |
| //do this if it's being resized down && params met | |
| } | |
| else { | |
| //do this if it's being resized up |
This file contains hidden or 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
| //expects the following vars to be set: | |
| // individual slides ".slideshow" | |
| // insert an element in addSliderBtns if there is a parent container class/ID | |
| function createSlideshow(){ | |
| cSlide = $('.slideshow:eq(0)'); //the current slide | |
| $('.slideshow').not(':eq(0)').hide(); //make all others invisible | |
| //add the next and previous buttons and set vars | |
| addSliderBtns(cSlide); ///create the buttons |
This file contains hidden or 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
| //User settings | |
| var maxSections = 5; | |
| var sectionNamePrefix = 'page-section'; | |
| var currSection = 1; | |
| function scrollToHash(e,sectionNumber) { | |
| var hash = '#' + sectionNamePrefix + sectionNumber; | |
| var target = $(hash); |
This file contains hidden or 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
| //uses a select box to input content from file into a text area | |
| var sel = $('select'); | |
| sel.change(function() { | |
| var f = $(this).val(); | |
| $.get("./path/to/file/" + f, function(d) { | |
| $('textarea').val(d); | |
| }) | |
| }) |