Is there a way to fire a fotorama click event from a template file?

What I am trying to do is have the functionality where, when the user selects an options from the dropdown from the catalog-product-view page, it fires a click event that will select a photo associated with that item.




$required = '';
if ($block->hasRequiredOptions()) {
    $required = ' data-hasrequired="' . __('* Required Fields') . '"';

<div class="product-options-wrapper" id="product-options-wrapper"<?php 
/* @escapeNotVerified */ echo $required; ?>>
  <div class="fieldset" tabindex="0">
      <?php echo $block->getChildHtml('', true);?>

<script type="text/javascript">
], function ($, fotorama, _, mediaCheck, template, galleryTpl, Class, $t) {
    'use strict';

    $(".specific-select select").on('change', function() {
        // gets value of option
        var thisvalue = $(this).find("option:selected").text();

        var slug = thisvalue.split(" ").join("-");
        slug = slug.substring(0, slug.length - 1).toLowerCase();

        /* want to simulate the click event on the fotorama slider here */


  • any update on this??? – Rizwan Khan Nov 24 '17 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.