Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Web программирование > JavaScript, Ajax
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 24.06.2011, 14:20   #1
krotik_06
Новичок
Джуниор
 
Регистрация: 02.11.2010
Сообщений: 2
По умолчанию Зациклить галерею

Добрый день. Мне нужна ваша помощь. Нужно зациклить вот эту галерею
http://ruseller.com/lessons.php?rub=37&id=486
Помогите пожалуйста, я пыталась, но у меня плохо получилось...
krotik_06 вне форума Ответить с цитированием
Старый 24.06.2011, 18:32   #2
krotik_06
Новичок
Джуниор
 
Регистрация: 02.11.2010
Сообщений: 2
По умолчанию Зациклить галарею

Хорошо, поставим вопрос по-другому....
Куда надо вставить 'ciclic':true, чтобы зациклить галерею?

Код:
$(document).ready(function(){
// Executed once all the page elements are loaded

	var preventClick=false;
	
	$(".pic a").bind("click",function(e){
		/* This function stops the drag from firing a click event and showing the lightbox */
		if(preventClick)
		{
			e.stopImmediatePropagation();
			e.preventDefault();
		}
	});

	$(".pic").draggable({
		/* Converting the images into draggable objects */
		containment: 'parent',
		start: function(e,ui){
			/* This will stop clicks from occuring while dragging */
			preventClick=true;
		},
		
		stop: function(e, ui) {
			/* Wait for 250 milliseconds before re-enabling the clicks */
			setTimeout(function(){ preventClick=false; }, 250);
		}
	});


	$('.pic').mousedown(function(e){
								 
		/* Executed on image click */
		
		var maxZ = 0;
		
		/* Find the max z-index property: */
		
		$('.pic').each(function(){
			var thisZ = parseInt($(this).css('zIndex'))
			if(thisZ>maxZ) maxZ=thisZ;
		});
		
		/* Clicks can occur in the picture container (with class pic) and in the link inside it */
		if($(e.target).hasClass("pic"))
		{
			/* Show the clicked image on top of all the others: */
			$(e.target).css({zIndex:maxZ+1});
		}
		else $(e.target).closest('.pic').css({zIndex:maxZ+1});
	});
	
	/* Converting all the links to a fancybox gallery */
	$("a.fancybox").fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		overlayShow:false
	});
	
	/* Converting the share box into a droppable: */
	$('.drop-box').droppable({
		hoverClass: 'active',
		drop:function(event,ui){
			/* Fill the URL text field with the URL of the image. */
			/* The id of the image is appended as a hash #pic-123 */
			$('#url').val(location.href.replace(location.hash,'')+'#'+ui.draggable.attr('id'));
			$('#modal').dialog('open');
		}
	});

	/* Converts the div with id="modal" into a modal window  */
	$("#modal").dialog({
		bgiframe: true,
		modal: true,
		autoOpen:false,
		buttons: {
				Ok: function() {
					$(this).dialog('close');
				}
			}
	});
	
	if(location.hash.indexOf('#pic-')!=-1)
	{
		/* Checks whether a hash is present in the URL */
		/* and shows the respective image */
		$(location.hash+' a.fancybox').click();
	}
	
});

Последний раз редактировалось JTG; 24.06.2011 в 19:51.
krotik_06 вне форума Ответить с цитированием
Старый 24.06.2011, 19:55   #3
JTG
я получил эту роль
Старожил
 
Аватар для JTG
 
Регистрация: 25.05.2007
Сообщений: 3,694
По умолчанию

Код:
$("a.fancybox").fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		overlayShow:false,
		cyclic: true
});
пыщь
JTG вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Как создать фото галерею? men232 Мультимедиа в Delphi 5 08.06.2011 13:07
Не могу вставить галерею слайдов в всплывающее окно. Nelly_ JavaScript, Ajax 6 20.05.2011 10:44
Как зациклить макрос? kapitel_bc@ukr.net Microsoft Office Excel 7 13.02.2010 23:48
Как правильно зациклить?) Roman_ PHP 3 01.05.2009 15:56
Помогите сделать галерею фото Никки JavaScript, Ajax 3 20.04.2008 05:12