JPretorius « visit
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to JPretorius - http://jpretorius.com
$(document).ready(function(){
//Set Variables for form checking
$checkName = 0;
$checkEmail = 0;
$("#close-welcome").click(function(){
$("#welcome-message").slideUp();
});
$(".artwork-holder").hover(
function(){
$(this).children(".toolbar").fadeIn();
},
function () {
$(this).children(".toolbar").fadeOut();
}
);
$("div.toolbar .preview-link, a.piece-link").click(function(ev){
ev.preventDefault();
var getUrl = $(this).attr("href");
$("div#mill-box").html(
"<div id='close-mill' onclick='closePreview()'></div><img src='"+getUrl+"'/>"
);
$("div#mill-box").css({top: "50%", marginTop: "-209px"});
$("div#mill-box").fadeIn("normal");
//Updated Animation:
setTimeout("$('div#close-mill').fadeIn();",300);
});
$("#submit").click(function(){checkForm()});
$("#name").blur(function(){
var name = $(this).val();
if (name == "") {
$("#form-name:visible").fadeOut(100);
setTimeout("$(\"#form-name\").html(\"<img src='img/form-cross.jpg'/>\")", 500);
setTimeout("$(\"#form-name\").fadeIn()", 800);
$checkName = 0;
} else {
$("#form-name:visible").fadeOut(100);
setTimeout("$(\"#form-name\").html(\"<img src='img/form-tick.jpg'/>\")", 500);
setTimeout("$(\"#form-name\").fadeIn()", 800);
$checkName = 1;
}
});
$("#email").blur(function(){
var email = $(this).val();
var isEmail = echeck(email);
if (isEmail == false) {
$("#form-email:visible").fadeOut(100);
setTimeout("$(\"#form-email\").html(\"<img src='img/form-cross.jpg'/>\")", 500);
setTimeout("$(\"#form-email\").fadeIn()", 800);
$checkEmail = 0;
} else if (isEmail == true){
$("#form-email:visible").fadeOut(100);
setTimeout("$(\"#form-email\").html(\"<img src='img/form-tick.jpg'/>\")", 500);
setTimeout("$(\"#form-email\").fadeIn()", 800);
$checkEmail = 1;
}
});
$("#video-preview-btn").click(function(){
$("#mooch-preview").fadeIn();
});
$("#mooch-preview-close").click(function(){
$("#mooch-preview").fadeOut();
});
});
function openToolbar(t) {
$(t).siblings("div").fadeIn();
}
function closePreview() {
$("div#mill-box").fadeOut();
}
function checkForm() {
var name = $("#name").val();
var email = $("#email").val();
var message = $("#message").val();
$num = $checkEmail + $checkName;
if ($num != 2) {
alert("Please check that you have entered all required fields.");
} else {
$.ajax({
type: "POST",
url: "/controllers/send.php",
data: "n="+name+"&e="+email+"&m="+message,
success: function(msg){
$("#contact-me-form").slideUp();
$("#thank-you").fadeIn();
}
});
}
//alert(message);
}
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
$ch = 0;
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
$ch = 0;
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
$ch = 0;
return false
}
if (str.indexOf(at,(lat+1))!=-1){
$ch = 0;
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
$ch = 0;
return false
}
if (str.indexOf(dot,(lat+2))==-1){
$ch = 0;
return false
}
if (str.indexOf(" ")!=-1){
$ch = 0;
return false
}
$ch = 1;
return true
}
Syndicate
Categories
Statistics
There are 330 Sites with 745 Links of Interest in 18 Categories. The latest Site was added 4 months ago.
About
This is a project by Sebastian Senf, for his part jQuery user and lover too. Follow me.