Архив

Публикации с меткой ‘javascript’
11 декабря 2013 Нет комментариев
function AutoPlayLink(right,left,count) {
	var	right=document.getElementById(right);
	var	left=document.getElementById(left);
	setInterval(function() {
		for (i=0;i<=count;i++) {
			setTimeout(right.click(),10000);
		}
		for (i=0;i<=count;i++) {
			setTimeout(left.click(),10000);
		}
	},5000);
}
$(document).ready(function(){
	AutoPlayLink('link_right','link_left',2);
});
Categories: Javascript Tags:
5 декабря 2013 Нет комментариев
$("#linkid").fancybox().trigger('click');
Categories: Javascript Tags:
5 декабря 2013 Нет комментариев
$('.class').fancybox({
	helpers:{
		title:{type:'over'}
	},
	beforeShow:function(){
		this.title=(this.title?''+this.title+'':'')+'Фотография '+(this.index+1)+' из '+this.group.length;
	}
});

veko

Categories: Javascript Tags:
5 декабря 2013 Нет комментариев
$(document).ready(function() {
	$("body").css("display","none");
	$("body").fadeIn(100);
	$("a").click(function(event){
		event.preventDefault();
		linkLocation=this.href;
		$("body").fadeOut(100,redirectPage);
	});
	function redirectPage() {
		window.location=linkLocation;
	}
});
Categories: Javascript Tags:
23 сентября 2013 Нет комментариев
$("a[href$='.jpg'],a[href$='.JPG'], a[href$='.png'], a[href$='.gif']").fancybox({
	'showCloseButton': false
}).hover(function() {
	$(this).click();
	$(".fancybox-overlay").mouseout(function() {
		$.fancybox.close();
	});
});
Categories: Javascript Tags: ,
18 сентября 2013 Нет комментариев

В примере в select выбираем option c нужным value (id — необходимое значение)

function InlineForm(id) {
	var poluch=document.getElementById('poluch');
	var poluch_o=poluch.options;
	$("#poluch").find("option").removeAttr("selected");
	for (i=0;i<poluch_o.length;i++) {
		if (poluch_o[i].value==id) {
			poluch[i].setAttribute("selected","selected");
			poluch[i].selected=true;
		}
	}
}
Categories: Javascript Tags:

javascript:

$(document).ready(function(){
	var session;
	var secpic=document.getElementById('secpic');
	$.ajaxSetup({cache:false})
	$.get('gs.php',{requested:'captcha'},function (data) {
		session=data;
		secpic.value=$.trim(session);
	});
});

php:

session_start();
if (isset($_GET['requested'])) {
	print $_SESSION[$_GET['requested']];
}
else {
	print json_encode($_SESSION);
}

html:

<input type="hidden" id="secpic" name="secpic" value=""/>

http://stackoverflow.com/questions/2765175/how-to-get-session-variables-from-php-server-with-ajax-function-php-html-js-aj

Categories: Javascript, PHP Tags: ,