Topic Closed
mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

After testing the Extreme Surfing template in 5.1 the dropdowns did not function - as i saw because of old code.

so i changed

global $page, $config;
 $page->head_js[] = rawurldecode($page->theme_path).'/jquery.dropotron-1.0.js';
 $page->head .= '$('.menu_top').dropotron({alignment:'left'});';

But i get :

array( [type] => (integer)4 [message] => (string)syntax error, unexpected '').dropotron({alignment:left})' (T_CONSTANT_ENCAPSED_STRING) [file] => (string)L:\xammp7025\htdocs\type511m4\themes\ExtremeSurfing\template.php [line] => (integer)16 )

Who has an idea how i can solve this syntax - problem ?  Removal of the 2 {} gives a slightly different error.

 

Edited: 3 years ago#11075

juergen
1.5K Posts
60.6K Downloads
16 Plugins
$page->head_js[] = rawurldecode($page->theme_path).'/jquery.dropotron-1.0.js';
$page->jQueryCode .= '$(".menu_top").dropotron({alignment:"left"});';

should do the trick

Edited: 3 years ago#11076

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

Not really - the error  has disappeared , and i have now all buttons (only) of the 1st level of the nav  instead of only 2, but the dropdown still doesnt function.

The dropotron is visible in the sourcecode of the site - so it must be something with the initiation code....[ the ('.menu_top').... comes from the original and functioned once ?]

To hide the code in an init.js doesnt create an error but the nav goes back to 2 Elements....

The template needs an update to Typesetter 5.1 - but i think i  will be able to finish it up...learning

Edited: 3 years ago#11077

juergen
1.5K Posts
60.6K Downloads
16 Plugins

If the JS errors are gone, it must be the initialization. Playing with the options might help, maybe openerClass: "haschildren"

'menu_top' is the default class name for the navigation <ul> unless redefined via $GP_MENU_CLASSES

3 years ago#11078

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins
Yes - tomorrow - but why has it functioned with the above initiation ? and why can i not put it into a init.js ?
Edited: 3 years ago#11079

juergen
1.5K Posts
60.6K Downloads
16 Plugins

but why has it functioned with the above initiation ?

and why can i not put it into a init.js ?

I don't know, need to test it myself.

Edited: 3 years ago#11080

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

I think it has something to do with the new typesetter - menu.

The new dropotron 1.43 has a great Codepen  https://codepen.io/VirtualFenix/pen/GgedpL

with a complicated Javascript   which shows all possibilities.

After i have finished it  i can put  a similar template together with a  responsive css into the repository.

3 years ago#11081

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

I think i found the main problem of extreme surfing : If i go with 'inspect element' on a menu-point  in the above Codepen,  then i see

<ul style="-moz-user-select: none; display: none; position: absolute; z-index: 1000; left: 466.217px; top: 91.1667px; opacity: 1;" class="dropotron level-0 left">

in firefox in typesetter on xampp i see only  <ul> .

But there is also a JS-Problem : The problems are in firefox,  in edge, opera  and safari 5.1 - but not in google chrome, where the dropdown functions -  perhaps my system - i must first see. (with dropotron 1.43 the dropdown stops functioning in chrome as well)

It looks like a small bug in Typesetter : 4.61 needed dropotron 1.43 - 5.1 has unclear changes...?

 

 

Edited: 3 years ago#11084

juergen
1.5K Posts
60.6K Downloads
16 Plugins

Try this one ExtremeSurfing_1_1.zip

I changed a few things:

  • Dropotron version 1.43 included (1.0 is not compatible with jQuery 1.11 anymore)
  • Loading of jquery.dropotron.min.js moved from settings.php to template.php
  • Menu output changed from 'TopTwoMenu' to 'FullMenu' (to see 3rd menu levels+)

But I did not make it responsive.

With Typesetter 5.1.1-b1 it works in all major desktop browsers including IE11 (not checked on mobiles).

Edited: 3 years ago#11086

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

Thank for Your support - this V1.1  functions also in my Firefox

In the between i revived the dropdown by simply changing

    $GP_MENU_CLASS = 'dropotron';

$(document).ready(function() {
        $('#menu ul').dropotron({
            offsetY: -22,
                mode: 'fade',
                noOpenerFade: true,
                speed: 300,
                detach: false
        });
    });       

strange - but the dropdown comes now - just is not responsive as my coming smartmenus-templates.

Edited: 3 years ago#11107

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Ennetb├╝rgen (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Websi...

Find out more about our Provider Spotlight

Log In

  Register