php
  • jquery
  • api
  • shopify
  • 2016-07-28 57 views 0 likes 
    0

    我想向我的product.liquid文件添加进度条。是否可以在shopify中通过脚本标签加载引导

    我正在通过使用内联样式的脚本标记来处理我的进度条。

    var append=''; 
    append +='<div style="'+divStyle+'"><center><p><span style="color: #000000;"><strong>HURRY! ONLY </strong>'; 
    append +='<strong style="color: #ff0000;" id="left-item" class="left-item">'+ userVisit +'</strong><strong> LEFT IN STOCK.</strong></span></p><center>'; 
    append +='<div style="background-color:#f5f5f5;border-radius:4px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.1) inset;height:20px;margin-bottom:20px;overflow:hidden;" id="style1" class="progress">'; 
    append +='<div style="width: '+ barWidth+'%;animation: 2s linear 0s normal none infinite running progress-bar-stripes;background-color: #D9534F;background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size: 40px 40px;box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15) inset;color: #fff;float: left;font-size: 12px;height: 100%;line-height: 20px;text-align: center;transition: width 0.6s ease 0s;" aria-valuemax="'+ data['max_count']+'" aria-valuemin="'+ data['min_count']+'" aria-valuenow="'+ userVisit+'" role="progressbar" class="progress-bar progress-bar-danger progress-bar-striped active">'; 
    append +='<span style="border: 0 none;clip: rect(0px, 0px, 0px, 0px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;" class="sr-only">80% Complete (danger)</span></div></div></div>'; 
    
    $(document).find('.progressBar').append(append); 
    

    我想加载bootstrap给我的进度条更多的样式。有没有解决方案。

    回答

    1

    你的问题有点令人困惑。但是,您可以自然地将自举(CSS文件和JavaScript文件)添加到Shopify主题。

    您可以将文件添加到您的主题,或通过Bootstrap的MaxCDN直接链接文件。

    对于后:

    1. 找到您theme.liquid编辑主题时,内部的布局
    2. <head></head>标记之间确保从Bootstrap Getting Started的代码片段粘贴下面引导CDN
    3. 保存,就是这样。

    取决于您的主题,你可能会有不同的片段最CSS和JavaScript文件(通常head-csshead-styleshead-jshead-scripts,但它们可以是任何东西)。随意跟随脚手架,并把你的引导CSS和你的引导JS应该在哪里。

    相关问题