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
// Preload images, append, & hide | |
$("a").has('img').each(function() { | |
$('<img />').attr('src',$(this).data("large-image")).appendTo('body').hide(); | |
}); |
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
// Disallows uploads over 2Mb | |
$(document).on('change', 'input[type=file]', function() { | |
//this.files[0].size gets the size of your file. | |
if (this.files[0].size > 2097152 || this.files[0].filesize > 2097152) { | |
alert('Your file is too large (over 2Mb). Please use a smaller file.') | |
$(this).wrap('<form>').closest('form').get(0).reset(); | |
$(this).unwrap(); | |
} | |
}); |
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
$('#authors > li').each(function(){ | |
var textstring = $(this).find('strong').text().split(" ("); | |
console.info(textstring[0]); | |
$(this).find('select[name^=user_map] option').filter(function() { | |
return $(this).text() == textstring[0]; | |
}).prop('selected', true); | |
}); |
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 jq = document.createElement('script'); | |
jq.src = "http://code.jquery.com/jquery-latest.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); |
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
$('#checkDelivery').submit(function() { | |
var data = $(this).serializeArray(), | |
postcodes = [2015,2019,2015,2018,2011]; | |
jQuery.each(data, function(i, field){ | |
if ( $.inArray(parseInt(field.value), postcodes) != -1 ) { | |
$('#delivery_options').html('<p>Yes, we deliver to your area!</p>'); | |
} | |
else { | |
$('#delivery_options').html('<p>Unfortunately, we do not deliver to your area.</p>'); | |
} |
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
<div id="MyForm"> | |
<form method="POST" name="info-form"> | |
<input type="hidden" value="/form-sent" name="returnURL" /> | |
<label for="First Name">First Name: </label> | |
<input type="text" name="First Name" maxlength="40" /> | |
<label for="Last Name">Last Name: </label> | |
<input type="text" name="Last Name" maxlength="80" /> | |
<label>Enter the below number: </label> | |
<input type="hidden" value="701469" id="verifyNumHidden" name="verifyNumHidden" /> | |
<input type="text" id="enterVerify" name="enterVerify" /> |
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
<form id="checkDelivery"> | |
<label for="postcode">Enter your postcode</label> | |
<input type="text" required name="postcode"/> | |
<button class="button">Submit</button> | |
</form> | |
<div id="delivery_options"></div> | |
<script> | |
$('#checkDelivery').submit(function() { | |
var data = $(this).serializeArray(), |
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(document).ready(function(){ | |
function randomgen() | |
{ | |
var rannumber=''; | |
for(ranNum=1; ranNum<=6; ranNum++){ | |
rannumber+=Math.floor(Math.random()*10).toString(); | |
} | |
$('#verifyNum').html(rannumber); | |
$('#verifyNumHidden').val(rannumber); | |
} |
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
<table class="productTable "> | |
<tbody> | |
<tr> | |
<td class="productItem"> | |
<div class="product_item"> | |
Product 1 | |
</div> | |
</td> | |
<td class="productItem"> | |
<div class="product_item"> |
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
$(".productTable").after("<div id='product-container'></div>"); | |
$(".productTable .product_item").appendTo("#product-container").each(function() {}); | |
$('.productTable').remove(); |