Page 87 of 96 FirstFirst ... 37778586878889 ... LastLast
Results 861 to 870 of 953
  1. #861
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Winchester Responsive

    One final look at this, if you add the line in red from my previous post and then remove the following lines from easyResponsiveTabs.js

    Code:
           //Update Browser History
                            if (historyApi) {
                                var currentHash = window.location.hash;
                                var tabAriaParts = $tabAria.split('tab_item-');
                                // var newHash = respTabsId + (parseInt($tabAria.substring(9), 10) + 1).toString();
                                var newHash = respTabsId + (parseInt(tabAriaParts[1], 10) + 1).toString();
                                if (currentHash != "") {
                                    var re = new RegExp(respTabsId + "[0-9]+");
                                    if (currentHash.match(re) != null) {
                                        newHash = currentHash.replace(re, newHash);
                                    }
                                    else {
                                        newHash = currentHash + "|" + newHash;
                                    }
                                }
                                else {
                                    newHash = '#' + newHash;
                                }
    
                                history.replaceState(null, null, newHash);
                            }
    This removes the errors and appears to have no effect on the functioning of the tabs, as designed by @picaflorazul i.e. no nested
    tabs and no changes to the url when selecting tabs.

    It's a bit of a hack so test it thoroughly,
    Simon

  2. #862
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Winchester Responsive

    Quote Originally Posted by simon1066 View Post
    It's a bit of a hack so test it thoroughly,
    Not sure if this would be any help, but it's not really a hack, see the code at Easy-Responsive-Tabs github site.

    I also call the script as:
    Code:
    <script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/easyResponsiveTabs.js' ?>" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#horizontalTab').easyResponsiveTabs({
                type: 'default', //Types: default, vertical, accordion           
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                        activate: function(event) { // Callback function if tab is switched
                    var $tab = $(this);
                    var $name = $('span', $info);
    
                    $name.text($tab.text());
    
                    $info.show();
                }
            });
    
            $('#verticalTab').easyResponsiveTabs({
                type: 'vertical',
                width: 'auto',
                fit: true
            });
        });
    </script>
    Works without errors on ZC 156c and 157, php7.3 and 7.4 Base template was RSB1.1
    Dave
    Always forward thinking... Lost my mind!

  3. #863
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Winchester Responsive

    Quote Originally Posted by davewest View Post
    Not sure if this would be any help, but it's not really a hack, see the code at Easy-Responsive-Tabs github site.

    I also call the script as:
    Code:
    <script src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/easyResponsiveTabs.js' ?>" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#horizontalTab').easyResponsiveTabs({
                type: 'default', //Types: default, vertical, accordion           
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                        activate: function(event) { // Callback function if tab is switched
                    var $tab = $(this);
                    var $name = $('span', $info);
    
                    $name.text($tab.text());
    
                    $info.show();
                }
            });
    
            $('#verticalTab').easyResponsiveTabs({
                type: 'vertical',
                width: 'auto',
                fit: true
            });
        });
    </script>
    Works without errors on ZC 156c and 157, php7.3 and 7.4 Base template was RSB1.1
    This code is pretty similar to that which I'm using. Not sure if the 'works without errors' was referring to the site in your signature, but I had a quick look at that to compare the html and js code with mine, and found that you do have the Uncaught ReferenceError: $info is not defined error.
    Simon

  4. #864
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Winchester Responsive

    Quote Originally Posted by simon1066 View Post
    This code is pretty similar to that which I'm using. Not sure if the 'works without errors' was referring to the site in your signature, but I had a quick look at that to compare the html and js code with mine, and found that you do have the Uncaught ReferenceError: $info is not defined error.
    Got it... sorry didn't spend time to read back.. still in the process of upgrading so files are off right now. sent the update to my live site.. $info is empty.. $info.show() is not used in accordion.. $name needs to be unique.. $name.show() doesn't seem to do anything in accordion... could be gone and still works.
    Code:
    <script>
        $(document).ready(function () {
            $('#horizontalTab').easyResponsiveTabs({
                type: 'default', //Types: default, vertical, accordion           
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                        activate: function(event) { // Callback function if tab is switched
                    var $tab = $(this);
                    var $name = $('span', ' ');
    
                    $name.text($tab.text());
    
                    $name.show();  //not used 
                }
            });
    
            $('#verticalTab').easyResponsiveTabs({
                type: 'vertical',
                width: 'auto',
                fit: true
            });
        });
    </script>
    Defining $info would work the same.
    Dave
    Always forward thinking... Lost my mind!

  5. #865
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Winchester Responsive

    Quote Originally Posted by davewest View Post
    Got it... sorry didn't spend time to read back.. still in the process of upgrading so files are off right now. sent the update to my live site.. $info is empty.. $info.show() is not used in accordion.. $name needs to be unique.. $name.show() doesn't seem to do anything in accordion... could be gone and still works.
    Code:
    <script>
        $(document).ready(function () {
            $('#horizontalTab').easyResponsiveTabs({
                type: 'default', //Types: default, vertical, accordion           
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                        activate: function(event) { // Callback function if tab is switched
                    var $tab = $(this);
                    var $name = $('span', ' ');
    
                    $name.text($tab.text());
    
                    $name.show();  //not used 
                }
            });
    
            $('#verticalTab').easyResponsiveTabs({
                type: 'vertical',
                width: 'auto',
                fit: true
            });
        });
    </script>
    Defining $info would work the same.
    Thanks, I tried defining $info, but the problem with that (and I think your code as it stands) is that on selecting a tab it strips out the URL path and replaces it with #horizontalTab1/2/3, which is no good if the page is refreshed.
    Simon

  6. #866
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Winchester Responsive

    Quote Originally Posted by simon1066 View Post
    Thanks, I tried defining $info, but the problem with that (and I think your code as it stands) is that on selecting a tab it strips out the URL path and replaces it with #horizontalTab1/2/3, which is no good if the page is refreshed.
    OK.. using the script as designed works outside of ZC, but for some reason not within.. $info was used to display wording after a tab was selected... not used here. removing caused the page history to change, thus the page refreshed issues. Within the easy tab script I comment out the script that was modifying the page history and all works again. I haven't really look deep into why it's changing page history, I don't think we need it unless using easy tabs for a product or catalog listing.

    I changed tpl_modules_product_discription.php
    Code:
        $(document).ready(function () {
            $('#horizontalTab').easyResponsiveTabs({
                type: 'default', //Types: default, vertical, accordion           
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                        activate: function(event) { }
            });
    
            $('#verticalTab').easyResponsiveTabs({
                type: 'vertical',
                width: 'auto',
                fit: true
            });
        });
    commented out in easyResponsiveTabs.js lines 142-159
    Code:
                            //Update Browser History
                        /*    if(historyApi) {
                                var currentHash = window.location.hash;
                                var newHash = respTabsId+(parseInt($tabAria.substring(9),10)+1).toString();
                                if (currentHash!="") {
                                    var re = new RegExp(respTabsId+"[0-9]+");
                                    if (currentHash.match(re)!=null) {                                    
                                        newHash = currentHash.replace(re,newHash);
                                    }
                                    else {
                                        newHash = currentHash+"|"+newHash;
                                    }
                                }
                                else {
                                    newHash = '#'+newHash;
                                }
                                
                                history.replaceState(null,null,newHash);
                            } */
    See if that works for you..
    Dave
    Always forward thinking... Lost my mind!

  7. #867
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: Winchester Responsive

    Thanks for looking at this. Yes, that does work for me. Similar to my original remedy with the additional removal of the $info from the php file.

    In case I ever want to be able to directly link to a tab - perhaps a future link to the reviews tab might be needed, I've decided not to remove those lines from the php file while at the same time defining $info. There are a couple of changes needed to easyResponsiveTabs.js to have the #tabname appended to the url rather than replacing it.
    Simon

  8. #868
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Winchester Responsive

    Quote Originally Posted by simon1066 View Post
    Thanks for looking at this. Yes, that does work for me. Similar to my original remedy with the additional removal of the $info from the php file.

    In case I ever want to be able to directly link to a tab - perhaps a future link to the reviews tab might be needed, I've decided not to remove those lines from the php file while at the same time defining $info. There are a couple of changes needed to easyResponsiveTabs.js to have the #tabname appended to the url rather than replacing it.
    My reviews are part of the page so I wouldn't need to link to anything. Some day when I slow down and finish updating I'll replace it with css as I use on other pages. like the reviews section does. Nice to have options..
    Dave
    Always forward thinking... Lost my mind!

  9. #869
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Winchester Responsive

    What's involved with getting the Winchester Responsive template to work with ZC 157b? Just a brief read through the threads, seems like some have got it working.

    Thanks!
    Experience is what you get when you don’t get what you want…

  10. #870
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Winchester Responsive

    Quote Originally Posted by kwright View Post
    What's involved with getting the Winchester Responsive template to work with ZC 157b? Just a brief read through the threads, seems like some have got it working.
    It is indeed a bit painful.

    What about the template has you wanting to use it? Is there a certain feature that drew your attention? What are your top 3 reasons?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 87 of 96 FirstFirst ... 37778586878889 ... LastLast

Similar Threads

  1. v154 Winchester Black Responsive Template
    By picaflor-azul in forum Addon Templates
    Replies: 497
    Last Post: 24 Apr 2023, 09:29 PM
  2. v155 Winchester Black responsive - looking for Social media icon flexible footer fix
    By MattA66 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 8 Jun 2021, 05:34 PM
  3. v155 Responsive Classic vs Responsive Sheffield Blue vs ?
    By Zean in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 May 2016, 07:01 AM
  4. v154 Where do I find the images for sliders, using Winchester Responsive Black
    By zbdude in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Apr 2016, 12:00 AM
  5. v153 Winchester Responsive - Trouble resizing carousel size?
    By hols.club in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Nov 2014, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR