Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-30-2009, 07:16 AM
EidolonAH EidolonAH is offline
 
Join Date: Apr 2009
Location: London, England
Posts: 178
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, javascript is horrible, I can't quite get it right, this is what I'm doing:

In the header I have this:
Code:
<div  id="wrap">
<!-- logo -->
<a name="top"></a>
    <div id="logo_block">
        <div id="logonav"><a href="$vboptions[forumhome].php$session[sessionurl_q]" title="$vboptions[bbtitle]"></a></div>
    </div>   
    <div id="border_block">
        <div id="borderleft">
            <div id="borderright">
                <div id="content_main" class="bodyfill">
                    <!-- content table -->
                        $spacer_open
                        $_phpinclude_output
                        $ad_location[ad_header_end]
                        <!-- nav buttons bar -->
                        <div style="text-align:center">
                        <a href="#" onclick="dom_toggle.toggle('menu_display', 'menu_open_close', 'images/skins/cyclone/buttons/button_menu_open.gif', 'images/skins/cyclone/buttons/button_menu_close.gif'); return false;"><img src="images/skins/cyclone/buttons/button_menu_open.gif" class="menutoggle" id="menu_open_close" alt="" /></a>
                        <div class="tborder" style="padding:$stylevar[cellspacing]px; border-top-width:0px">
                        	<table cellpadding="0" cellspacing="0" border="0" width="100%">
                        	<tr align="center">
                        		<if condition="$show['member']">
                        			<td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
                        		</if>
                        		<if condition="$show['registerbutton']">
                        			<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
                        		</if>
                        		$template_hook[navbar_buttons_left]
                        		<td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
                        		<if condition="$show['communitylink'] AND $show['popups']">
                        			<td class="vbmenu_control"><a id="community" href="$show[nojs_link]#community" rel="nofollow" accesskey="6">$vbphrase[community]</a> <script type="text/javascript"> vbmenu_register("community"); </script></td>
                        		<else />
                        			<if condition="$show['memberslist']">
                        				<td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
                        			</if>
                        			<if condition="$show['quick_links_groups']">
                        				<td class="vbmenu_control"><a href="group.php?$session[sessionurl]">$vbphrase[social_groups]</a></td>
                        			</if>
                        		</if>
                        		<td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
                        		<if condition="$show['popups']">
                        			<if condition="$show['searchbuttons']">
                        				<if condition="$show['member']">
                        				<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                        				<else />
                        				<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                        				</if>
                        				<td class="vbmenu_control"><a id="navbar_search" href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
                        			</if>
                        			<if condition="$show['member']">
                        				<td class="vbmenu_control"><a id="usercptools" href="$show[nojs_link]#usercptools" accesskey="3">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>
                        			</if>
                        		<else />
                        			<if condition="$show['searchbuttons']">
                        				<td class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4">$vbphrase[search]</a></td>
                        				<if condition="$show['member']">
                        				<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                        				<else />
                        				<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                        				</if>
                        			</if>
                        			<td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
                        			<if condition="$show['member']">
                        				<td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_contacts]</a></td>
                        			</if>
                        		</if>
                        		$template_hook[navbar_buttons_right]
                        		<if condition="$show['member']">
                        			<td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')">$vbphrase[log_out]</a></td>
                        		</if>
                        		</tr>
                        	</table>
                        </div>
                        </div>
                        <!-- / nav buttons bar -->
In the headinclude I have this:
Code:
<script type="text/javascript" src="$stylevar[imgdir_misc]/js_dom_toggle.js"></script>
In the .js file there is this:
Code:
function _dom_toggle()
{
	return this;
}
	_dom_toggle.prototype.objref = function(id)
	{
		return document.getElementById ? document.getElementById(id) : (document.all ? document.all[id] : (document.layers ? document.layers[id] : null));
	}

	_dom_toggle.prototype.cancel_event = function()
	{
		if ( window.event )
		{
			window.event.cancelBubble = true;
		}
	}

	_dom_toggle.prototype.toggle = function(id, open_close_id, open_icon, close_icon)
	{
		var object = this.objref(id);
		var icon = this.objref(open_close_id);

		if ( object && object.style )
		{
			object.style.display = (object.style.display == 'none') ? '' : 'none';
			if ( icon && icon.src )
			{
				icon.src = (object.style.display == 'none') ? open_icon : close_icon;
			}
		}
		this.cancel_event();
	}

// instantiate
dom_toggle = new _dom_toggle();
For the css I have this:
Code:
.menutoggle {
	margin: 0;
	padding: 0;
        border:0px;
	width: 200px;
	height: 30px;
}
.menutoggle a:hover {
	background: url(images/skins/cyclone/buttons/button_menu_impel.gif);
	margin: 0;
	padding: 0;
        border:0px;
	width: 200px;
	height: 30px;
}
The hover effect is not working, the menu is displayed by default, the javascript isn't running when I click the menu button.
Any ideas on what I have got wrong?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04644 seconds
  • Memory Usage 2,503KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete