Помощник
|
смещение блоков при клике |
maximamus
|
Сообщение
#1
|
||
|
|
||
|
|||
Degradator |
3.2.2015, 15:19;
Ответить: Degradator
Сообщение
#2
|
|
Оче похоже на реализацию слайдера, у которого отключен автоскролл.
|
|
|
maximamus
|
Сообщение
#3
|
|
Degradator, удалось сделать таким методом http://jsfiddle.net/neq47pv1/, принцип работы такой и нужен, только есть ли решение которое позволит сделать не через импуты и лейбы?
|
|
|
maximamus
|
Сообщение
#4
|
|
так "приятно" быть на мертвых форумах...
|
|
|
Degradator |
4.2.2015, 16:50;
Ответить: Degradator
Сообщение
#5
|
|
Degradator, удалось сделать таким методом http://jsfiddle.net/neq47pv1/, принцип работы такой и нужен, только есть ли решение которое позволит сделать не через импуты и лейбы? Это красивое решение, но если надо что-то менять, то нужно прикручивать js. |
|
|
maximamus
|
Сообщение
#6
|
|
Degradator,
хочу сделать так, что бы при клике на таб1 или таб3, текст "перемещался" на место таб2 |
|
|
Degradator |
5.2.2015, 10:23;
Ответить: Degradator
Сообщение
#7
|
|
не знаю как сделано оформление табов, похоже на рисунок. Если это действительно рисунок, то можно при помощи js считать размер таба, и при помощи var interval = setInterval(function(){code; clearInterval(interval)}, 100); сделать анимацию. Если юзаешь jquery или что-то подобное, то там это скорее всего реализовано (в jquery это animate())
|
|
|
maximamus
|
Сообщение
#8
|
|
|
Degradator, нет, увы полный ноль что в js, что jquery
вот файл нашел, вродь в нем идет функция табов [JS]jQuery(document).ready(function ($) { // Spoiler $('body:not(.su-other-shortcodes-loaded)').on('click', '.su-spoiler-title', function (e) { var $title = $(this), $spoiler = $title.parent(), bar = ($('#wpadminbar').length > 0) ? 28 : 0; // Open/close spoiler $spoiler.toggleClass('su-spoiler-closed'); // Close other spoilers in accordion $spoiler.parent('.su-accordion').children('.su-spoiler').not($spoiler).addClass('su-spoiler-closed'); // Scroll in spoiler in accordion if ($(window).scrollTop() > $title.offset().top) $(window).scrollTop($title.offset().top - $title.height() - bar); e.preventDefault(); }); $('.su-spoiler-content').removeAttr('style'); // Tabs $('body:not(.su-other-shortcodes-loaded)').on('click', '.su-tabs-nav span', function (e) { var $tab = $(this), data = $tab.data(), index = $tab.index(), is_disabled = $tab.hasClass('su-tabs-disabled'), $tabs = $tab.parent('.su-tabs-nav').children('span'), $panes = $tab.parents('.su-tabs').find('.su-tabs-pane'), $gmaps = $panes.eq(index).find('.su-gmap:not(.su-gmap-reloaded)'); // Check tab is not disabled if (is_disabled) return false; // Hide all panes, show selected pane $panes.hide().eq(index).show(); // Disable all tabs, enable selected tab $tabs.removeClass('su-tabs-current').eq(index).addClass('su-tabs-current'); // Reload gmaps if ($gmaps.length > 0) $gmaps.each(function () { var $iframe = $(this).find('iframe:first'); $(this).addClass('su-gmap-reloaded'); $iframe.attr('src', $iframe.attr('src')); }); // Set height for vertical tabs tabs_height(); // Open specified url if (data.url !== '') { if (data.target === 'self') window.location = data.url; else if (data.target === 'blank') window.open(data.url); } e.preventDefault(); }); // Activate tabs $('.su-tabs').each(function () { var active = parseInt($(this).data('active')) - 1; $(this).children('.su-tabs-nav').children('span').eq(active).trigger('click'); tabs_height(); }); // Activate anchor nav for tabs and spoilers anchor_nav(); // Lightbox $('.su-lightbox').each(function () { $(this).on('click', function (e) { e.preventDefault(); e.stopPropagation(); if ($(this).parent().attr('id') === 'su-generator-preview') $(this).html(su_other_shortcodes.no_preview); else { var type = $(this).data('mfp-type'); $(this).magnificPopup({ type: type, tClose: su_magnific_popup.close, tLoading: su_magnific_popup.loading, gallery: { tPrev: su_magnific_popup.prev, tNext: su_magnific_popup.next, tCounter: su_magnific_popup.counter }, image: { tError: su_magnific_popup.error }, ajax: { tError: su_magnific_popup.error } }).magnificPopup('open'); } }); }); // Tables $('.su-table tr:even').addClass('su-even'); // Frame $('.su-frame-align-center, .su-frame-align-none').each(function () { var frame_width = $(this).find('img').width(); $(this).css('width', frame_width + 12); }); // Tooltip $('.su-tooltip').each(function () { var $tt = $(this), $content = $tt.find('.su-tooltip-content'), is_advanced = $content.length > 0, data = $tt.data(), config = { style: { classes: data.classes }, position: { my: data.my, at: data.at, viewport: $(window) }, content: { title: '', text: '' } }; if (data.title !== '') config.content.title = data.title; if (is_advanced) config.content.text = $content; else config.content.text = $tt.attr('title'); if (data.close === 'yes') config.content.button = true; if (data.behavior === 'click') { config.show = 'click'; config.hide = 'click'; $tt.on('click', function (e) { e.preventDefault(); e.stopPropagation(); }); $(window).on('scroll resize', function () { $tt.qtip('reposition'); }); } else if (data.behavior === 'always') { config.show = true; config.hide = false; $(window).on('scroll resize', function () { $tt.qtip('reposition'); }); } else if (data.behavior === 'hover' && is_advanced) { config.hide = { fixed: true, delay: 600 } } $tt.qtip(config); }); // Expand $('.su-expand').each(function () { var $this = $(this), $content = $this.children('.su-expand-content'), $more = $this.children('.su-expand-link-more'), $less = $this.children('.su-expand-link-less'), data = $this.data(), col = 'su-expand-collapsed'; $more.on('click', function (e) { $content.css('max-height', 'none'); $this.removeClass(col); }); $less.on('click', function (e) { $content.css('max-height', data.height + 'px'); $this.addClass(col); }); }); function is_transition_supported() { var thisBody = document.body || document.documentElement, thisStyle = thisBody.style, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; return support; } // Animations is supported if (is_transition_supported()) { // Animate $('.su-animate').each(function () { $(this).one('inview', function (e) { var $this = $(this), data = $this.data(); window.setTimeout(function () { $this.addClass(data.animation); $this.addClass('animated'); $this.css('visibility', 'visible'); }, data.delay * 1000); }); }); } // Animations isn't supported else { $('.su-animate').css('visibility', 'visible'); } function tabs_height() { $('.su-tabs-vertical').each(function () { var $tabs = $(this), $nav = $tabs.children('.su-tabs-nav'), $panes = $tabs.find('.su-tabs-pane'), height = 0; $panes.css('min-height', $nav.outerHeight(true)); }); } function anchor_nav() { // Check hash if (document.location.hash === '') return; // Go through tabs $('.su-tabs-nav span[data-anchor]').each(function () { if ('#' + $(this).data('anchor') === document.location.hash) { var $tabs = $(this).parents('.su-tabs'), bar = ($('#wpadminbar').length > 0) ? 28 : 0; // Activate tab $(this).trigger('click'); // Scroll-in tabs container window.setTimeout(function () { $(window).scrollTop($tabs.offset().top - bar - 10); }, 100); } }); // Go through spoilers $('.su-spoiler[data-anchor]').each(function () { if ('#' + $(this).data('anchor') === document.location.hash) { var $spoiler = $(this), bar = ($('#wpadminbar').length > 0) ? 28 : 0; // Activate tab if ($spoiler.hasClass('su-spoiler-closed')) $spoiler.find('.su-spoiler-title:first').trigger('click'); // Scroll-in tabs container window.setTimeout(function () { $(window).scrollTop($spoiler.offset().top - bar - 10); }, 100); } }); } if ('onhashchange' in window) $(window).on('hashchange', anchor_nav); $('body').addClass('su-other-shortcodes-loaded'); });[/JS]
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Мегамаркет. Скидка 1000 рублей при покупке от 5000 рублей на все, на первый заказ. Мегамаркет. Скидка 1000 рублей при покупке от 5000 рублей на все, на п |
7 | stu999 | 1753 | 31.3.2024, 11:19 автор: stu999 |
|
ПРОЦЕССИНГ НА РУ-КАРТЫ, КИВИ, СИМ С ГАРАНТИЕЙ ОТ БЛОКОВ | 0 | Dark_process | 1014 | 7.11.2022, 13:48 автор: Dark_process |
|
Получил странную ссылку при линкбилдинге Как поведет себя поиск при обнаружении странной ссылке? |
10 | r0mZet | 2203 | 24.10.2022, 19:23 автор: Wachowski |
|
300 площадок под вечные ссылки на выбор: ТИЦ 20-9400, PR 0-6, ЯК, DMOZ. Скидки при пакетном заказе! | 65 | inkon | 30379 | 19.7.2022, 13:41 автор: Funoman |
|
тИЦ отменили! Новый показатель Яндекса ИКС! Лучшие площадки под размещение. Бесплатное написание статей при любом заказе. Эксклюзивное предложение. Успей получить написание статей БЕСПЛАТНО |
71 | VIMstat | 78480 | 21.6.2022, 9:38 автор: VIMstat |
Текстовая версия | Сейчас: 19.4.2024, 23:45 |