在django中实现shopify模板(Implement shopify templates in django)
我买了Ella Shopify模板,因为它的设计很棒,可以在Django项目中实现它。 购买后我发现它不是标准的html5 css3模板,带有一堆“.liquid”文件。 但是当我打开几个文件时,我发现模板语言是相似的。 我需要知道是否可以在Django中使用“.liquid”文件作为Shopify主题。 请指教,因为我真的很喜欢这个模板。
我买的模板是http://themeforest.net/item/ella-responsive-shopify-template/9691007 。
至少我可以将“.liquid”文件转换为HTML5吗?
谢谢。
I bought Ella Shopify template because of its awesome design look to implement it in Django project in rush. After buying it I found that it isn't a standard html5 css3 template with bunch of ".liquid" files. But when I opened few files I found that the template language is similar. I need to know is it possible to use ".liquid" files for a Shopify theme in Django. Please advise because I really love this template.
Template I bought is at http://themeforest.net/item/ella-responsive-shopify-template/9691007.
At least can I transform ".liquid" files into HTML5?
Thanks.
原文:https://stackoverflow.com/questions/36236784
最满意答案
您可以使用相同的
button
和boxes
class
名称。data-target
attr用于指定要切换的元素。更新
- 每个按钮切换功能
- 添加了
Bold
文本切换功能$(document).ready(function() { $('.click').click(function(event) { event.stopPropagation(); if($(".showup").eq($(this).attr('data-target')).css('display') == 'block'){ $(".showup").eq($(this).attr('data-target')).slideUp(); $('.click').removeClass('bold') } else{ $(".showup").hide(); $('.click').removeClass('bold') $(".showup").eq($(this).attr('data-target')).slideToggle("fast"); $(this).toggleClass('bold') } }); }).on('click',function(){ $(".showup").hide(); $('.click').removeClass('bold') })
body { margin: 50px; } .showup{ width: 100%; height: 100px; background: red; display: none; position: fixed; } .bold{ font-weight:bold; } .click{ cursor: pointer; display: inline-block; padding: 0 15px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="click" data-target="0">Link 1</div> <div class="click" data-target="1">Link 2</div> <div class="showup">something I want to show</div> <div class="showup">something else I want to show</div>
You could do with same
class
name of thebutton
andboxes
.data-target
attr used for target the which element to toggling .Updated
- Toggle function with each button
Bold
text toggle function added$(document).ready(function() { $('.click').click(function(event) { event.stopPropagation(); if($(".showup").eq($(this).attr('data-target')).css('display') == 'block'){ $(".showup").eq($(this).attr('data-target')).slideUp(); $('.click').removeClass('bold') } else{ $(".showup").hide(); $('.click').removeClass('bold') $(".showup").eq($(this).attr('data-target')).slideToggle("fast"); $(this).toggleClass('bold') } }); }).on('click',function(){ $(".showup").hide(); $('.click').removeClass('bold') })
body { margin: 50px; } .showup{ width: 100%; height: 100px; background: red; display: none; position: fixed; } .bold{ font-weight:bold; } .click{ cursor: pointer; display: inline-block; padding: 0 15px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="click" data-target="0">Link 1</div> <div class="click" data-target="1">Link 2</div> <div class="showup">something I want to show</div> <div class="showup">something else I want to show</div>
相关问答
更多-
您需要定位正确的内容,使用当前元素,即使用.next()子.next()后面的兄弟。 $('.etape-road-trip').click(function () { var currentContent = $(this).next().find('.infos-etape-road-trip'); $('.infos-etape-road-trip').not(currentContent).slideUp(); currentContent.slideToggle(); }) ...
-
尝试 $(document).ready(function () { var $frm = $('#form').hide(); var $bts = $("button.tog").on('click', function () { var $this = $(this) $bts.filter(".active").not(this).removeClass('active'); $this.toggleClass('active'); ...
-
$(document).on('click', 'button', onButtonClick) var clicked = false; function onButtonClick() { if(clicked) { return; } target = $(this).attr('class') if ($('.active')[0]) { if(!$('.active').hasClass(target)) { ...
-
看起来问题是,您正在检查在幻灯片动画有机会完成之前是否隐藏了paydays_tbody。 从技术上讲,它在动画完成之前不会隐藏。 尝试在完整的回调中移动if块,它应该工作: $( "#pdays_expand" ).on( "click", function() { $( "#pdays_tbody" ).slideToggle( "slow", function() { //$('body').scrollTo($('#pdays_tbody'),500); $("#pdays_exp ...
-
编辑评论 如果您不想检查标记等,可以使用以下内容来实现您想要的内容: $("#irN, #myir, #myirmsg").click(function () { var example = "#" + this.id + "_dd"; $(example).siblings("div[id$=_dd]").slideUp() .is(":visible") ...
-
您可以使用相同的button和boxes class名称。 data-target attr用于指定要切换的元素。 更新 每个按钮切换功能 添加了Bold文本切换功能 $(document).ready(function() { $('.click').click(function(event) { event.stopPropagation(); if($(".showup").eq($(this).attr('data-target')).css('display') == ' ...
-
可能会试试这个 $('.postBoxShowAll').click(function() { $('.postBoxContent').slideToggle('fast', function() { if ($('.postBoxContent').is(':hidden')) { $('.postBoxShowAll').html('Show all'); } else { $('.postBoxShowAll') ...
-
有很多方法可以实现的折叠效果; 与您的实际代码1结束了这一点。 1使用全局范围可变currElem来处理最后使用acordion元件; 比当手风琴元件被点击检查,如果1是使用jQuery相同的元素is方法。 说明:检查当前匹配组针对一个选择器,元件,或jQuery对象元素,并且如果这些元素中的至少一个给定的参数匹配,则返回真。 最终的代码如下所示: var currElem; $(function () { $('#philosophyOpen').click(function () { ...
-
slideToggle Div和Rotate Icon如果可见或隐藏(slideToggle Div and Rotate Icon if visible or hidden)[2021-08-31]
UPDATE 修剪HTML 对于图标的旋转使用toggleClass ('glyphicon-circle-arrow-down glyphicon-circle-arrow-right') ; 将panel和icon更改为data-panel和data-icon 将.attr()更改为.data() 。 panel和icon不是属性。 data-panel和data-icon有效,值是字符串,正是您所需要的。 .data()是与data-*属性一起使用的推荐方法。 另外.delegate()不建议使用.o ... -
你必须等到slideToggle()动画实际完成才能确定它是否:visible或不:visible 。 您可以传递回调: var ulToggle = $(this).parent().children("ul"); var liToggle = $(this).parent(); ulToggle.slideToggle("slow", function() { if (ulToggle.is(":visible")){ $(liToggle).addClass("ativo") ...