Показать сообщение отдельно
 12.09.2013, 00:35  
По умолчанию Re: Создание сайтов на Joomla 1.5/2.5, Качественно, недорого!
#16
  Duke_Cheb Duke_Cheb вне форума
  The Scarecrow
 Аватар для Duke_Cheb
Детали профиля (+/-)
Ответов: 5,851
Регистрация: 26.03.2012
Спасибо:1,633/856
Не понравилось:33/2
Репутация: 5587

2-я половина:
+ Нажмите здесь, чтобы увидеть полный текст
function clickHandler(e) **
e.preventDefault();
scroll(this._o.top + 1);
**
**
function productsPage(options) **
var opt = $.extend(**
**, options);
var $o = $(opt.selector);
if (!$o.length) return;
$o.find('.filter a').click(filterClick);
function filterClick(e) **
e.preventDefault();
var $i = $(this).parent(),
typeId = $(this).data('type');
if ($i.hasClass('active')) **
$i.removeClass('active').parents(opt.selector).eq( 0).find('.product').show();
** else **
$i.siblings().removeClass('active').end().addClass ('active')
.parents(opt.selector).eq(0).find('.product').hide ().filter('[data-type="' + typeId + '"]').show();
**
**
**
function tabs(options) **
var opt = $.extend(**
**, options);
var $wrap = $(opt.selector);
if (!$wrap.length) return;
var $links = $wrap.find('.tabs a').click(_select),
$cnt = $wrap.find('.cnt');
function _select(e) **
e.preventDefault();
var i = $links.index(this);
$links.removeClass('active').eq(i).addClass('activ e');
$cnt.removeClass('active').eq(i).addClass('active' );
**
**
function pageBlock(options) **
var opt = $.extend(**
visiblePages : 5
**, options);
$(opt.selector).each(function() **
$(this).data('pageBlock', new PageBlock(this, opt));
**);
**
function cities(options) **
var opt = $.extend(**
animationDuration : 200
**, options);
var $wraps = $(opt.selector);
if (!$wraps.length) return;
$wraps.each(function() **
var $wrap = $(this);
var $blocks = $wrap.find('.cities-cont>div').hide();
var $links = $wrap.find('.cities a').click(_toggle);
$links.filter('.active').removeClass('active').tri gger('click');
$blocks.find('.close').click(_close);
function _toggle(e) **
e.preventDefault();
var $t = $(this),
city = $t.text();
if (!$t.data('block')) **
for (var i = 0; i < $blocks.length; i++) **
var c = $blocks.eq(i).find('h3').text();
if (c == city) **
$t.data('block', $blocks.eq(i));
$blocks.eq(i).data('link', $t);
break;
**
**
**
if ($t.data('block')) **
$t.toggleClass('active');
$t.data('block').toggle(opt.animationDuration);
**
**
function _close(e) **
e.preventDefault();
var $block = $(this).parents('div').eq(0);
if ($block.data('link')) **
$block.data('link').trigger('click');
**
**
**);
**
function PageBlock(el, options) **
this.el = el;
this.$el = $(el);
this.opt = options;
this.pages = this.$el.data('pages');
this.url = this.$el.data('url');
this.page = this.$el.data('page') || 1;
this.$el.wrapInner('<div class="cll page-block-in"></div>');
this.$cnt = this.$el.find('.page-block-in');
this.createPagination();
this._vis();
**
function popupFiles(options) **
$(options.selector).click(function(e)**
e.preventDefault();
simplePopup.show(**
'title' : $(this).find('span.pTitle').html(),
'content' : $(this).parent().find('div.pContent').html()
**);
**);
**
PageBlock.prototype.createPagination = function() **
var self = this;
this.$pages = $('<div class="pagination"></div>').prependTo(this.$el);
for (var i = 1; i <= this.pages; i++) **
this.$pages.append('<a href="#"><ins>' + i + '</ins></a>');
**
this.$nums = this.$pages.find('a');
if (this.pages > this.opt.visiblePages + 2) **
this.$nums.slice(1, -1).wrapAll($('<span class="scroll"></span>').width(this.$nums[this.opt.visiblePages - 2].offsetLeft));
this.$scroll = this.$pages.find('.scroll');
**
this.$pages.prepend(this.$prev = $('<a href="#" class="prev"><img src="/static/img/l.png"></a>'));
this.$pages.append(this.$next = $('<a href="#" class="next"><img src="/static/img/r.png"></a>'));
this.$nums.click(function(e) **
e.preventDefault();
self.go($(this).text());
**);
this.$prev.click(function(e) **
e.preventDefault();
self.go(self.page - 1);
**);
this.$next.click(function(e) **
e.preventDefault();
self.go(self.page + 1);
**);
**;
PageBlock.prototype._vis = function() **
if (this.page > 1)
this.$prev.removeClass('invisible');
else
this.$prev.addClass('invisible');
if (this.page < this.pages)
this.$next.removeClass('invisible');
else
this.$next.addClass('invisible');
this.$nums.removeClass('active').eq(this.page - 1).addClass('active');
if (this.$scroll) **
var nPage = Math.max(this.page - Math.ceil(this.opt.visiblePages / 2 - 1), 2);
this.$scroll.stop().animate(**
scrollLeft : this.$scroll.find('a')[nPage - 2].offsetLeft
**, 200);
**
**;
PageBlock.prototype.go = function(page) **
if ((page >= 1) && (page <= this.pages)) **
this.page = page;
this.get();
this._vis();
**
**
PageBlock.prototype.get = function() **
var self = this;
if (this.url) **
this.$cnt.append('<span class="loading"></span>');
$.ajax(**
url : this.url,
cache : true,
dataType : 'html',
data : **
page : this.page
**,
type : 'GET',
success : function(resp) ** self.parse(resp); **
**);
**
**
PageBlock.prototype.parse = function(resp) **
this.$cnt.html(resp);
**
var Popup = (function() **
var $overlay = null,
$popup = null,
$thumbs = null,
$thumbsU = null,
$l = null,
imgIndex = -1,
lW = 0;
var IE = (($.browser.msie) && ($.browser.version < 9));
function thumbClick(e) **
e.preventDefault();
var index = $thumbs.index(this);
if (imgIndex === index)
return;
if (imgIndex > -1) **
$thumbs.eq(imgIndex).parent().removeClass('active' );
**
imgIndex = index;
var $t = $thumbs.eq(imgIndex).parent().addClass('active');
var $u = $thumbsU,
scrollLeft = $u.scrollLeft(),
uw = $u.width(),
l = $t.position().left,
w = $t.width();
if (l + w > uw) **
$u.animate(**
scrollLeft : scrollLeft + l + w - uw
**, 200, 'swing');
** else if (l < 0) **
$u.animate(**
scrollLeft : scrollLeft + l
**, 200, 'swing');
**
showPic(this.href);
**
function showPic(src) **
var img = new Image;
img.onload = drawPic;
img.src = src;
**
function drawPic() **
var img = this;
var $wr = $popup.find('.big'),
w = $wr.width(),
h = $wr.height(),
k = 1;
if (img.width > w) **
k = w / img.width;
img.width *= k;
img.height *= k;
**
if (img.height > h) **
k = h / img.height;
img.width *= k;
img.height *= k;
**
if ($l) **
$l.fadeOut(300, function() ** $(this).remove(); **);
**
$l = $('<span></span>').css(**
width : img.width,
height : img.height,
marginLeft : -img.width / 2,
marginTop : -img.height / 2
**).hide().append(img).appendTo($wr).fadeIn(300);
**
function prevnext(e) **
e.preventDefault();
var c = ($(this).hasClass('arr-lft')) ? -1 : 1;
var index = imgIndex + c;
if (index < 0) ** index = $thumbs.length - 1; ** else if (index > $thumbs.length - 1) ** index = 0; **
$thumbs.eq(index).trigger('click');
**
var scrollTimeout = 0, scrollDirection = 0, thumbsScrolling = true;
function thumbsScroll(e) **
e.preventDefault();
thumbsScrolling = true;
scrollDirection = ($(this).hasClass('arr-lft')) ? -1 : 1;
_tScroll();
$(document.body).one('mouseup', function() ** thumbsScrolling = false; **);
**
function _tScroll() **
var scrollLeft = $thumbsU.scrollLeft();
$thumbsU.animate(**
scrollLeft : scrollLeft + scrollDirection * lW
**, 200, 'swing', function() ** if (thumbsScrolling) ** window.setTimeout(_tScroll, 100); ** **);
**
function overlayShow() **
if (!$overlay) **
$overlay = $('<div class="popup-overlay"></div>').hide().appendTo(document.body).click(Popup. close);
**
if (IE) **
$overlay.show();
** else **
$overlay.fadeIn(300);
**
**
function overlayHide() **
if (IE) **
$overlay.hide();
** else **
$overlay.fadeOut(300);
**
**
return **
load : function(url, link) **
$.getJSON(url, function(data) **
Popup.show(data);
**)
**,
show : function(data) **
overlayShow();
$popup = $('<div class="popup"><div class="close"></div><div class="title">' + data['title'] + '</div>').css(**
top : document.body.scrollTop + document.documentElement.scrollTop
**).hide().appendTo(document.body);
$popup.find('.close').click(Popup.close);
if (data.photos) **
$popup.append('<div class="gallery"><div class="big"><div class="arr arr-lft"></div><div class="arr arr-rgt"></div></div><div class="thumbs"><div class="arr arr-lft"></div><div class="arr arr-rgt"></div><ul></ul></div></div>')
$thumbsU = $popup.find('.thumbs ul');
$thumbsU.scrollLeft(0);
for (var i = 0; i < data.photos.length; i++) **
var p = data.photos[i];
$thumbsU.append('<li><a href="' + p.src + '"><img src="' + p.thumb + '"><ins></ins></a></li>');
**
$thumbs = $thumbsU.find('a').click(thumbClick);
$popup.find('.big .arr').click(prevnext);
$popup.find('.thumbs .arr').mousedown(thumbsScroll);
lW = $thumbsU.find('li').eq(0).outerWidth(true);
if (data.content) **
$popup.find('.gallery').append($('<div class="cnt"></div').html(data.content));
**
**
if (IE) **
$popup.show();
** else **
$popup.fadeIn(300);
**
if (data.photos) **
$thumbs.eq(0).trigger('click');
**
**,
close : function() **
$popup.remove();
$popup = $thumbs = $l = null;
imgIndex = -1;
overlayHide();
**,
setupAjaxLinks : function() **
$('[data-popup-load]').click(function(e) **
e.preventDefault();
Popup.load($(this).data('popupLoad'), this);
**)
**
**;
**)();
function selects(options) **
var opt = $.extend(**
defaultPlaceholder : ''
**, options);
$(opt.selector).each(setupSelect);
var $cur;
function setupSelect(i, el) **
var $el = $(el);
var $obj = $('<div class="sselect"><div class="scurrent"><span></span><ins></ins></div><div class="spopup"><div></div></div></div>')
.insertAfter($el)
.css(**
width : $el.outerWidth()
**)
.data(**
placeholder : $el.data('placeholder') || opt.defaultPlaceholer,
select : el
**)
.append($el.hide());
var $list = $obj.find('.spopup div');
for (var i = 0; i < el.options.length; i++) **
$('<a href="#"></a>').html(el.options[i].text).data(** 'value' : el.options[i].value, 'i' : i **).appendTo($list);
**
$obj.mousedown(function(e) ** e.preventDefault(); e.stopImmediatePropagation(); **);
$obj.find('a').click(option);
$obj.find('.scurrent').click(show);
select($obj, el.selectedIndex);
**
function select($o, index) **
var select = $o.data('select'),
option = select.options[index],
value = option.value,
text = option.text;
var changed = select.value != value;
select.value = value;
$o
.data('value', value)
.find('.scurrent span')
.html((text !== '' && text !== undefined) ? text : $o.data('placeholder'));
if (changed && select.onchange)
select.onchange();
**
function option(e) **
e.preventDefault();
var $e = $(this),
$o = $e.parents('.sselect').eq(0);
select($o, $e.data('i'));
close();
**
function show(e) **
e.preventDefault();
var $o = $(this).parent();
if ((!$cur) || ($cur[0] !== $o[0])) **
close();
$cur = $o.addClass('sanim sactive');
$(document.body).one('mousedown', close);
** else **
close();
**
**
function close() **
if ($cur) **
$cur.removeClass('sactive');
$cur = null;
**
**
**
var newsView = (function() **
var $popup = null,
$thumbs = null,
$thumbsU = null,
$l = null,
imgIndex = -1,
lW = 0;
var IE = (($.browser.msie) && ($.browser.version < 9));
function thumbClick(e) **
e.preventDefault();
var index = $thumbs.index(this);
if (imgIndex === index)
return;
if (imgIndex > -1) **
$thumbs.eq(imgIndex).parent().removeClass('active' );
**
imgIndex = index;
var $t = $thumbs.eq(imgIndex).parent().addClass('active');
var $u = $thumbsU,
scrollLeft = $u.scrollLeft(),
uw = $u.width(),
l = $t.position().left,
w = $t.width();
if (l + w > uw) **
$u.animate(**
scrollLeft : scrollLeft + l + w - uw
**, 200, 'swing');
** else if (l < 0) **
$u.animate(**
scrollLeft : scrollLeft + l
**, 200, 'swing');
**
showPic(this.href);
**
function showPic(src) **
var img = new Image;
img.onload = drawPic;
img.src = src;
**
function drawPic() **
var img = this;
var $wr = $popup.find('.big'),
w = $wr.width(),
h = $wr.height(),
k = 1;
if (img.width > w) **
k = w / img.width;
img.width *= k;
img.height *= k;
**
if (img.height > h) **
k = h / img.height;
img.width *= k;
img.height *= k;
**
if ($l) **
$l.fadeOut(300, function() ** $(this).remove(); **);
**
$l = $('<span></span>').css(**
width : img.width,
height : img.height,
marginLeft : -img.width / 2,
marginTop : -img.height / 2
**).hide().append(img).appendTo($wr).fadeIn(300);
**
function prevnext(e) **
e.preventDefault();
var c = ($(this).hasClass('arr-lft')) ? -1 : 1;
var index = imgIndex + c;
if (index < 0) ** index = $thumbs.length - 1; ** else if (index > $thumbs.length - 1) ** index = 0; **
$thumbs.eq(index).trigger('click');
**
var scrollTimeout = 0, scrollDirection = 0, thumbsScrolling = true;
function thumbsScroll(e) **
e.preventDefault();
thumbsScrolling = true;
scrollDirection = ($(this).hasClass('arr-lft')) ? -1 : 1;
_tScroll();
$(document.body).one('mouseup', function() ** thumbsScrolling = false; **);
**
function _tScroll() **
var scrollLeft = $thumbsU.scrollLeft();
$thumbsU.animate(**
scrollLeft : scrollLeft + scrollDirection * lW
**, 200, 'swing', function() ** if (thumbsScrolling) ** window.setTimeout(_tScroll, 100); ** **);
**
return **
show : function() **
$popup = $('.newsView');
$thumbsU = $popup.find('.thumbs ul');
$thumbsU.scrollLeft(0);
$thumbs = $thumbsU.find('a').click(thumbClick);
if ($thumbs.length)
**
$popup.find('.big .arr').click(prevnext);
$popup.find('.thumbs .arr').mousedown(thumbsScroll);
lW = $thumbsU.find('li').eq(0).outerWidth(true);
$thumbs.eq(0).trigger('click');
**
**
**;
**)();
var simplePopup = (function() **
var $overlay = null,
$popup = null;
var IE = (($.browser.msie) && ($.browser.version < 9));
function overlayShow() **
if (!$overlay) **
$overlay = $('<div class="popup-overlay"></div>').hide().appendTo(document.body).click(simple Popup.close);
**
if (IE) **
$overlay.show();
** else **
$overlay.fadeIn(300);
**
**
function overlayHide() **
if (IE) **
$overlay.hide();
** else **
$overlay.fadeOut(300);
**
**
return **
show : function(data) **
overlayShow();
$popup = $('<div class="popup"><div class="close"></div><div class="title">' + data.title + '</div>').css(**
top : document.body.scrollTop + document.documentElement.scrollTop
**).hide().appendTo(document.body);
$popup.find('.close').click(simplePopup.close);
$popup.append('<div class="gallery"></div>');
$popup.find('.gallery').append($('<div class="cnt"></div').html(data.content));
if (IE) **
$popup.show();
** else **
$popup.fadeIn(300);
**
**,
close : function() **
$popup.remove();
$popup = null;
overlayHide();
**
**;
**)();
________________
If you're playing Rock 'n' Roll, play It without lies.
Always be as brave and proud, like an eagle in the sky!
If you want to be remembered, there is one thing you should do:
When you play your music, gotto keep It true
!
© "Majesty"
  Вверх