Forums / General / crazy "21" template problem

crazy "21" template problem

Author Message

cloud stone

Friday 04 February 2011 5:03:29 am

hello, we have a crazy problem with for loop.

in general we work with a template which build an video gallery.

we use jq tooltip to dynamically display video content.

whatever, everything works fine if the quantity of video items that we create in this "for loop" is < 21.

if the quantity is >=21 the qj tooltip don't work as expected.

the error:

as you se we override the jq tooltip event "mouseenter, mouseleave" to " click, "" "

this works as expected if our loop is < 21. if its >20 the mouseenter event comes back and we get a crazy mixture of both events.

example code without video content. the example is reduced to the minimal code structure to reproduce our error.

{def $cols=5
     $rows=8
     $video_count=21
     $field_count=40
     $random_field_nrs=ssl_randomlist(0,$field_count|sub(1),$video_count)}

<div class="videoarea">

  {def $video_index=0}
  {for 0 to $field_count|sub(1) as $index}
    {if and(lt($video_index, $video_count),
            $random_field_nrs|contains($index))}

      <div class="video">
       previewimage
      </div>
      <div class="tooltip">
           video {$index}
      </div>

      {set $video_index = $video_index|inc()}
      {continue}
    {/if}

  {/for}
  {undef}
  <div class="clear"></div>
</div>

{literal}
  <script type="text/javascript">
    $jq(document).ready(function() {
      $jq(".video").tooltip({
        effect: 'slide',
        events: { def: 'click, ',
                  tooltip: 'mouseover'
                }
      });
    });
  </script>
{/literal}

greetings

André R.

Friday 04 February 2011 6:14:26 am

So it's a jq issue? Then what is jq? jQuery? fork of jQuery?
Anyway, if it is jq issue, then this is not the place to post question about it.

If not then you should probably leave jq out of it if you want answears, simply:
What html output do you expect from the code and what do you get?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

cloud stone

Sunday 06 February 2011 8:56:51 am

i wrote "jq" as an abbreviation for jQuery ( javascript library at http://jquery.com ). sorry if it produce ambiguity.

i am not so familiar with javascript, ezPublish templates and so on. web technologies in general are new land for me.

whatever, i will move this question to the jQuery forum. but if somebody here know a similar effect- or understand my question- or find a problem/error in my code. i am very happy about tips or suggestions.

------------------------

EDIT 2.11.2011:

SOLVED! it was a simple jQwery problem.

eZ debug

Timing: Jan 18 2025 03:04:16
Script start
Timing: Jan 18 2025 03:04:16
Module start 'content'
Timing: Jan 18 2025 03:04:16
Module end 'content'
Timing: Jan 18 2025 03:04:16
Script end

Main resources:

Total runtime0.6577 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 592.0234180.8516
Module start 'content' 0.00520.5261 772.8750547.4766
Module end 'content' 0.53140.1262 1,320.3516332.7578
Script end 0.6576  1,653.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5693210.0002
Check MTime0.00140.2143210.0001
Mysql Total
Database connection0.00060.095510.0006
Mysqli_queries0.592490.06461940.0031
Looping result0.00180.27961920.0000
Template Total0.634896.520.3174
Template load0.00220.332320.0011
Template processing0.632696.182120.3163
Template load and register function0.00020.026810.0002
states
state_id_array0.00070.108710.0007
state_identifier_array0.00070.106420.0003
Override
Cache load0.00180.2737270.0001
Sytem overhead
Fetch class attribute can translate value0.00180.268830.0006
Fetch class attribute name0.00130.203040.0003
XML
Image XML parsing0.00080.119930.0003
class_abstraction
Instantiating content class attribute0.00000.002140.0000
General
dbfile0.00170.2606280.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0004 secs