// JavaScript Document $(function() { /* BALLOON */ $("#balloon1").hover(function() { $("#balloon1").addClass("balloonholder2"); $("#balloont1").addClass("balloontop2"); },function() { $("#balloon1").removeClass("balloonholder2"); $("#balloont1").removeClass("balloontop2"); }); $("#balloon2").hover(function() { $("#balloon2").addClass("balloonholder2"); $("#balloont2").addClass("balloontop2"); },function() { $("#balloon2").removeClass("balloonholder2"); $("#balloont2").removeClass("balloontop2"); }); $("#balloon3").hover(function() { $("#balloon3").addClass("balloonholder2"); $("#balloont3").addClass("balloontop2"); },function() { $("#balloon3").removeClass("balloonholder2"); $("#balloont3").removeClass("balloontop2"); }); $("#balloon4").hover(function() { $("#balloon4").addClass("balloonholder2"); $("#balloont4").addClass("balloontop2"); },function() { $("#balloon4").removeClass("balloonholder2"); $("#balloont4").removeClass("balloontop2"); }); $("#balloon5").hover(function() { $("#balloon5").addClass("balloonholder2"); $("#balloont5").addClass("balloontop2"); },function() { $("#balloon5").removeClass("balloonholder2"); $("#balloont5").removeClass("balloontop2"); }); $("#balloon6").hover(function() { $("#balloon6").addClass("balloonholder2"); $("#balloont6").addClass("balloontop2"); },function() { $("#balloon6").removeClass("balloonholder2"); $("#balloont6").removeClass("balloontop2"); }); /* BALLOON 2 */ $("#aballoon1").hover(function() { $("#taballoon1").addClass("tballoonholder2"); $("#aballoont1").addClass("balloontop2"); },function() { $("#taballoon1").removeClass("tballoonholder2"); $("#aballoont1").removeClass("balloontop2"); }); $("#aballoon2").hover(function() { $("#taballoon2").addClass("tballoonholder2"); $("#aballoont2").addClass("balloontop2"); },function() { $("#taballoon2").removeClass("tballoonholder2"); $("#aballoont2").removeClass("balloontop2"); }); $("#aballoon3").hover(function() { $("#taballoon3").addClass("tballoonholder2"); $("#aballoont3").addClass("balloontop2"); },function() { $("#taballoon3").removeClass("tballoonholder2"); $("#aballoont3").removeClass("balloontop2"); }); $("#aballoon4").hover(function() { $("#taballoon4").addClass("tballoonholder2"); $("#aballoont4").addClass("balloontop2"); },function() { $("#taballoon4").removeClass("tballoonholder2"); $("#aballoont4").removeClass("balloontop2"); }); $("#aballoon5").hover(function() { $("#taballoon5").addClass("tballoonholder2"); $("#aballoont5").addClass("balloontop2"); },function() { $("#taballoon5").removeClass("tballoonholder2"); $("#aballoont5").removeClass("balloontop2"); }); $("#aballoon6").hover(function() { $("#taballoon6").addClass("tballoonholder2"); $("#aballoont6").addClass("balloontop2"); },function() { $("#taballoon6").removeClass("tballoonholder2"); $("#aballoont6").removeClass("balloontop2"); }); /* ADD MOOD */ $("#aballoon1").click(function(event){ vmoodid = 1; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); $("#aballoon2").click(function(event){ vmoodid = 2; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); $("#aballoon3").click(function(event){ vmoodid = 3; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); $("#aballoon4").click(function(event){ vmoodid = 4; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); $("#aballoon5").click(function(event){ vmoodid = 5; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); $("#aballoon6").click(function(event){ vmoodid = 6; vartid = $("#hidartid").val(); $.post( "http://www.spot.ph/addmood.php", { moodid: vmoodid, artid: vartid }, function(data) { $('#artmoodset').html(data); } ); }); /* MOVE ARTICLE SOCIAL (ARTICLE) */ if ($(window).width() > 999) { $(window).scroll(function(){ var contentdiv = $("#artcontent"); var contentpos = contentdiv.position(); var footerdiv = $("#footer"); var footerpos = footerdiv.position(); if ($(document).scrollTop() >= footerpos.top - 800) { $('#skinningimg').hide("fade", 500); $('#skinninglink').hide("fade", 500); } else if ($(document).scrollTop() >= 600 - $("#artsocial2").height() + $("#artcontent").height() - 350) { $('#skinningimg').show("fade", 500); $('#skinninglink').show("fade", 500); document.getElementById('artsocial2').style.top = "15px"; document.getElementById('artsocial2').style.position = "fixed"; document.getElementById('artcontent').style.marginLeft = "48px"; document.getElementById('artsocial2').style.display = "none"; } else if (($(document).scrollTop() >= contentpos.top) || ($(document).scrollTop() >= 600)) { $('#skinningimg').show("fade", 500); $('#skinninglink').show("fade", 500); $('#bugreport').fadeIn(); $('#backtotop').fadeIn(); document.getElementById('artsocial2').style.top = "15px"; document.getElementById('artsocial2').style.position = "fixed"; document.getElementById('artcontent').style.marginLeft = "46px"; document.getElementById('artsocial2').style.display = "inline-block"; } else if ($(document).scrollTop() <= 600 - $("#artsocial2").height() + $("#artcontent").height() - 250 - 1100) { $('#bugreport').fadeOut(); $('#backtotop').fadeOut(); $('#skinningimg').show("fade", 500); $('#skinninglink').show("fade", 500); document.getElementById('artsocial2').style.top = "0px"; document.getElementById('artsocial2').style.position = "relative"; document.getElementById('artcontent').style.marginLeft = "0px"; document.getElementById('artsocial2').style.display = "inline-block"; } else { $('#skinningimg').show("fade", 500); $('#skinninglink').show("fade", 500); $('#bugreport').fadeOut(); $('#backtotop').fadeOut(); document.getElementById('artsocial2').style.top = "0px"; document.getElementById('artsocial2').style.position = "relative"; document.getElementById('artcontent').style.marginLeft = "0px"; document.getElementById('artsocial2').style.display = "inline-block"; } }); } else { $(window).scroll(function(){ var contentdiv = $("#artcontent"); var contentpos = contentdiv.position(); var footerdiv = $("#footer"); var footerpos = footerdiv.position(); if ($(document).scrollTop() >= 600 - $("#socialmobile").height() + $("#artcontent").height() - 350) { document.getElementById('socialmobile').style.top = "15px"; document.getElementById('socialmobile').style.position = "fixed"; document.getElementById('socialmobile').style.display = "none"; } else if (($(document).scrollTop() >= contentpos.top) || ($(document).scrollTop() >= 600)) { $('#bugreport').fadeIn(); $('#backtotop').fadeIn(); document.getElementById('socialmobile').style.top = "15px"; document.getElementById('socialmobile').style.position = "fixed"; document.getElementById('socialmobile').style.display = "inline-block"; } else if ($(document).scrollTop() <= 600 - $("#socialmobile").height() + $("#artcontent").height() - 250 - 1100) { $('#bugreport').fadeOut(); $('#backtotop').fadeOut(); document.getElementById('socialmobile').style.top = "0px"; document.getElementById('socialmobile').style.position = "relative"; document.getElementById('socialmobile').style.display = "inline-block"; } else { $('#bugreport').fadeOut(); $('#backtotop').fadeOut(); document.getElementById('socialmobile').style.top = "0px"; document.getElementById('socialmobile').style.position = "relative"; document.getElementById('socialmobile').style.display = "inline-block"; } }); } /* SOCIAL EXPAND (ARTICLE) */ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { $('#artsocial2').click(function(){ var toggleWidth = $("#socialdiv").width(); if(toggleWidth == 30 || toggleWidth == 32){ $('#socialdiv').animate({ width: "230px" }, 100, function() { $('#socialright').css('opacity', 1); $('#socialright').css('position', 'relative'); $('#socialright').css('left', '0px'); }); } else{ $('#socialright').css('position', 'absolute'); $('#socialright').css('left', '-5000px'); $('#socialright').css('opacity', 0); $('#socialdiv').css('width', '30px'); } }); } else{ $('#artsocial2').hover(function(){ $('#socialdiv').animate({ width: "230px" }, 100, function() { $('#socialright').css('opacity', 1); $('#socialright').css('position', 'relative'); $('#socialright').css('left', '0px'); }); }, function() { $('#socialright').css('position', 'absolute'); $('#socialright').css('left', '-5000px'); $('#socialright').css('opacity', 0); $('#socialdiv').css('width', '30px'); }); } });