var $jq = jQuery.noConflict();
var timeRef=Date.now();
var state = 0;
var oldJQueryEventTrigger = jQuery.event.trigger;
function resetTimer(){
timeRef=Date.now();
}
jQuery.event.trigger = function( event, data, elem, onlyHandlers ) {
console.log("RESETTO TIMER");
resetTimer();
oldJQueryEventTrigger( event, data, elem, onlyHandlers );
}
function addPin(poi,i){
if(!poi.isFixed()){
do{
// poi.x = 346;
// poi.y = 332;
poi.x=Math.floor(Math.random() * 1200);
poi.y=Math.floor(Math.random() * 700);
}while(!isFree(poi,i));
}
// var img = $jq('
');
var img = $jq('
');
img.click(function(){ // handle click
var c = $jq("#container_" + poi.type);
if(poi.type=='T'){ //contenuto testuale
$jq.get("contents/"+poi.type+"_"+i+".html", function(html_string)
{
c.html('
' + html_string + '
');
},'html');
}else if(poi.type=='V'){//contenuto video
c.html('');
c.attr('currentTime',"0");
c.trigger('load');
c.trigger('play');
}else{//รจ un'immagine
c.html('
');
}
c.modal();
});
// $jq('body').delay(Math.floor(Math.random() * 1001)).append( img );
// $jq('body').append('').delay(2000).queue(function (next) {
// $jq(this).append(img);
// next();
// });
$jq('body').append( img );
img.delay(500);
img.animate({top: poi.y + 'px'},'fast');
img.animate({left: poi.x + 'px'},'fast');
}
function toScsv(){
state=0;
$jq.get("asset/scsv.html", function(html_string){
var body = $jq('body');
body.html(html_string);
$jq("#myVideo").on( "click", function(){toRiver();} )
$jq(".mword").on( "click", function(){toRiver();} )
},'html');
}
function toRiver(){
state=1;
$jq.get("asset/river.html", function(html_string){
var body = $jq('body');
body.html(html_string);
$jq('.cat').on('click',function(e){
if($jq(this).hasClass( "cat_OFF" )){
//is going on
$jq(this).removeClass( "cat_OFF" );
for (let i=0; i=60000 && state==1){
toScsv();
}
}, 5000);