vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Rollovers in Postbit (https://vborg.vbsupport.ru/showthread.php?t=86470)

ixian 03-03-2003 12:53 AM

Rollovers in Postbit
 
What's the magic trick to get rollovers to work in the Postbit? Such as for the icons for profile, reply, quote, etc etc.

I have js rollovers working just fine in my vb header. However, when I try the exact same code even, in postbit (such as modifying postbit_profile and adding the rollover code to the link) it does not work.

I've double-checked the images - there are there in the right paths. And I don't get any javascript errors on the page - just no rollovers either. I have the js code in my vb header but I am wondering, do I need to insert it somewhere else for rollover images to work in the postbit?

Anyone with any examples? I'd really appreciate it!

Thanks,

Ixian

Tony G 03-03-2003 02:54 AM

What code are you using? So I can check it over for you.

Chris Gwynne 03-03-2003 03:16 AM

Everything should work if you have the code in the header, make sure there is actual images to rollover like quoteroll.gif or something like that. But, like Tony said, show us the code.. ;)

Brad 03-03-2003 03:26 AM

Acully it would be better to stick it under the $header call in the showthread template so it isent loaded on all pages.

Chris Gwynne 03-03-2003 04:39 AM

Quote:

Originally Posted by Anime-loo
Acully it would be better to stick it under the $header call in the showthread template so it isent loaded on all pages.

Although if you have a separate .js file, it won't really matter, will load quicker too :p

ixian 03-03-2003 03:28 PM

Huh. I would sworn I selected email notification for this thread, but I didn't get any.

Anyway, the code looks something like this:

In the head insert template:

PHP Code:

<script language="JavaScript">
<!--

function 
MM_preloadImages() { //v3.0
  
var d=document; if(d.images){ if(!d.MM_pd.MM_p=new Array();
    var 
i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0i<a.lengthi++)
    if (
a[i].indexOf("#")!=0){ d.MM_p[j]=new Imaged.MM_p[j++].src=a[i];}}
}

function 
MM_findObj(nd) { //v4.01
  
var p,i,x;  if(!dd=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    
d=parent.frames[n.substring(p+1)].documentn=n.substring(0,p);}
  if(!(
x=d[n])&&d.allx=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(
i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!
&& d.getElementByIdx=d.getElementById(n); return x;
}

function 
MM_showHideLayers() { //v6.0
  
var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (
i=0i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (
obj.style) { obj=obj.stylev=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    
obj.visibility=v; }
}

function 
MM_swapImgRestore() { //v3.0
  
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function 
MM_swapImage() { //v3.0
  
var i,j=0,x,a=MM_swapImage.argumentsdocument.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((
x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrcx.oSrc=x.srcx.src=a[i+2];}
}
//-->
</script

And then, for example, in Postbit_profile (for the profile button in Postbit):

PHP Code:

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$post[userid]onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image110','','/assets/images/profile_01-over.gif',1)"><img src="/assets/images/profile_01.gif" alt="Profile" name="Image110" width="72" height="22" border="0"></a

Now, as I mentioned, if I put the link above in the header template, it works fine. So, the code is working, and the images are there.

It just doesn't work if placed in, for example, postbit_profile, and I don't know why.

Could be I horked something up since I use that code for rollovers in my header already anyway. Any ideas???

Thanks!


All times are GMT. The time now is 06:39 PM.

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.04585 seconds
  • Memory Usage 1,761KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete