Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Wookmark jQuery Plugin

    karabey

    • Schreiberling
    • Beiträge: 320
    • Geschlecht:
    Wookmark jQuery Plugin
    am: 20. Dezember 2012, 11:49:20
    Hallo,

    Ich versuche gerade den Wookmark im Shop einzusetzen. Es sollte Neue Produkte auf Wookmark Art auflisten.

    Vorgang

    jquery.wookmark.js in den Ordner /javascript und dann in general.js einbinden
    Code: PHP  [Auswählen]
    <script type="text/javascript" src="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/javascript/jquery.wookmark.js"></script>

    style.css unbennant in wookmark.css und in den Ordner /css sowie in general.css eingebunden
    Code: PHP  [Auswählen]
    <link rel="stylesheet" href="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/css/wookmark.css" type="text/css" media="screen" />

    Damit der Javascript nicht überall aufgerufen wird habe ich es direkt in den new_products_default.html eingepackt
    Code: Javascript  [Auswählen]
    <script type="text/javascript">
        $(document).ready(new function() {
          // Prepare layout options.
          var options = {
            autoResize: true, // This will auto-update the layout when the browser window is resized.
            container: $('#main'), // Optional, used for some extra CSS styling
            offset: 2, // Optional, the distance between grid items
            itemWidth: 210 // Optional, the width of a grid item
          };
         
          // Get a reference to your grid items.
          var handler = $('#tiles li');
         
          // Call the layout function.
          handler.wookmark(options);
         
          // Capture clicks on grid items.
          handler.click(function(){
            // Randomize the height of the clicked item.
            var newHeight = $('img', this).height() + Math.round(Math.random()*300+30);
            $(this).css('height', newHeight+'px');
           
            // Update the layout.
            handler.wookmark();
          });
        });
      </script>

    Zuletzt ruft man nur noch die neuesten Produkte in new_products_default.html auf
    Code: PHP  [Auswählen]
    <div id="main" role="main">

          <ul id="tiles">{foreach name=aussen item=module_data from=$module_content}
            {if $module_data.PRODUCTS_IMAGE!=''}
            <li><a href="#"><img src="{$module_data.PRODUCTS_IMAGE}" alt="{$module_data.PRODUCTS_NAME}" /></a><p>{$module_data.PRODUCTS_NAME}</p></li>
            {/if}{/foreach}
          </ul>

        </div>

    Hier erscheinen nur die neuesten Produkte zwar aber das Javascript möchte nicht die einzelnen boxen nebeneinander sortieren. Gehe ich mit der Schleife falsch um?

    Linkback: https://www.modified-shop.org/forum/index.php?topic=23815.0
    15 Antworten
    7751 Aufrufe
    13. Juli 2015, 17:43:14 von MoSaG
    30 Antworten
    15587 Aufrufe
    21. September 2019, 11:50:14 von Markus
    68 Antworten
    5305 Aufrufe
    19. Oktober 2023, 05:38:22 von vr
    5 Antworten
    4122 Aufrufe
    10. Juni 2015, 17:32:15 von fishnet