Script not firing

Solved
Highlighted
New Member
3 0 0

I have two versions of my website. One that has the functionality I want while the other doesn't seem to be working. It seems that a script is not firing. Why would this be? Everything is the same when it comes to the html5 and css. 

 

This section works:

<div class="Feature-{{section.id}}">
<div class="responsive cv_feature_blocks">
{% for block in section.blocks %}
<div class="cv_feature_content">
{% if block.settings.cv_feature_icon != blank %}
<img src="{{block.settings.cv_feature_icon | img_url:'medium'}}" class="cv_feature_img_fluid">
{% endif %}
{% if block.settings.featured_title != blank %}
<span class="cv_feature_text">
<h3>{{ block.settings.featured_title}}</h3>
</span>
{% endif %}
{% if block.settings.cv_feature_content != blank %}
<span class="feature_paragraph_content">
<p>{{ block.settings.cv_feature_content}}</p>
</span>
{% endif %}
</div>
{% endfor %}
</div>
</div>


<script>
$('.responsive').slick({
dots: false,
infinite: true,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
</script>
{% schema %}
{
"name": "Feature Block Icons",
"blocks":[

{
"type":"Feature_content",
"name":"Feature_blocks",

"settings": [


{
"type":"image_picker",
"id":"cv_feature_icon",
"label":"Image"
},


{
"type":"text",
"id":"featured_title",
"label":"Title"

},

{
"type":"text",
"id":"cv_feature_content",
"label":"Description"

}

 


]
}
],

"settings": [],
"presets":[{
"name":"Feature Content",
"category":"Feature_Blocks"
}]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

This one doesn't:

<div class="Feature-{{section.id}}">
<div class="responsive cv_feature_blocks">
{% for block in section.blocks %}
<div class="cv_feature_content">
{% if block.settings.cv_feature_icon != blank %}
<img src="{{block.settings.cv_feature_icon | img_url:'medium'}}" class="cv_feature_img_fluid">
{% endif %}
{% if block.settings.featured_title != blank %}
<span class="cv_feature_text">
<h3>{{ block.settings.featured_title}}</h3>
</span>
{% endif %}
{% if block.settings.cv_feature_content != blank %}
<span class="feature_paragraph_content">
<p>{{ block.settings.cv_feature_content}}</p>
</span>
{% endif %}
</div>
{% endfor %}
</div>
</div>


<script>
$('.responsive').slick({
dots: false,
infinite: true,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
</script>
{% schema %}
{
"name": "Feature Block Icons",
"blocks":[

{
"type":"Feature_content",
"name":"Feature_blocks",

"settings": [


{
"type":"image_picker",
"id":"cv_feature_icon",
"label":"Image"
},


{
"type":"text",
"id":"featured_title",
"label":"Title"

},

{
"type":"text",
"id":"cv_feature_content",
"label":"Description"

}

 


]
}
],

"settings": [],
"presets":[{
"name":"Feature Content",
"category":"Feature_Blocks"
}]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

 

Same code , so I am not sure why it isn't firing the script.

0 Likes
Highlighted
Shopify Expert
808 67 188

This is an accepted solution.

My guess is that you have a javascript error somewhere that is breaking functionality / preventing other scripts from loading.

Start by checking the console for errors - if you're not familiar this guide will help: https://speedboostr.com/finding-and-fixing-server-errors.

If you'd rather just have the problem fixed, contact my team at speedboostr.com/contact with your website url and the problem. Our developers are all Shopify focused and regularly fix things like this.

Founder of Speed Boostr (Shopify optimization and dev agency).
Creator of Theme Scientist (A/B testing app).
Creator of Order Automator (app that auto tags + fulfills orders, send emails).
Creator of Tip Jar (add a tip button to your store).
Creator of Shopify Analyzer (free performance analysis tool).
My team also builds custom apps and automated solutions.
Enjoy the adventure!
0 Likes