- Create Account

Divscroll + Tipster

Forums > Combining Scripts > Divscroll + Tipster > Page 1
Pages: 1 , 2 - Next > >
Author
Message

1) innodev Group: Guests
IP: 219.65.--.--
Dear Angus

Congratulations on putting up some great scripts. Actually this message should perhaps be a new thread, but I did not know how to start a new one. I have seen topics in these forums, on combining various scripts, but there seems to be nothing on combinning 'divscroll' and 'tipster'. Any guidelines for combining? I tried using the two scripts separately, but the scroller thumb wouldn't move. Anybody who has successfully combined these two scripts can share experience for others' benefit.

2) Angus Turnbull Group: Guests
IP: 210.54.--.--
If you don't mind I've taken the liberty of moving it to a new thread as it's a valid point -- you can create a new topic via the "Create New Topic" link at the top of the topics listing, by the way.

Anyway, the sticker with these two scripts is the document.onmousemove event. You can find it in both beneath the data section, it looks like:

document.onmousemove = function()
{
 blahblahblah();
}


where blahblahblah() are the function(s) called by each script. Delete this little block in BOTH scripts and paste this in ONCE instead:

document.onmousemove = function(evt)
{
 docTips.track(evt);
 staticTip.track(evt);
 nestTip.track(evt);
stickyTip.track(evt);

 var ret = scrThumbMove(evt);
 return (ret  ? (isNS4?document.routeEvent(evt):true) : false);
}

It might sound a little weird, but unknown wise people back in the v4 browsers day decided that each event can only really be assigned once, so you occasionally have to do some cutting and pasting like that. This is a combined function that calls both scripts properly. Also, you can add or remove tip objects as per normal from this function.

Good luck - Angus.

3) JD Group: Guests
IP: 194.47.--.--
Hello!

I’ve been experimenting a bit with the combination of the Scroller and Tipster.

First of all I moved the entire
<SCRIPT language=JavaScript><!—blubb blubb //--></SCRIPT>
section of Tipster into the head of Scroller.

Then I deleted
document.onmousemove = function() { blahblahblah();  }
in the script handling Tipster and changed the onmousemove part in the Scroller script to
document.onmousemove = function(evt)
{
docTips.track(evt);
staticTip.track(evt);
nestTip.track(evt);
stickyTip.track(evt);

var ret = scrThumbMove(evt);
return (ret  ? (isNS4?document.routeEvent(evt):true) : false);
}
as  you said in the post above.

Also I placed all the
<div id="docTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden;
 left: 0px; top: 0px; width: 10px">&nbsp;</div>
divs from the body of Tipster into the body of the Scroller.

And then of course I put all the styles in the Scroller file.

Think thats all I did. Now the thing is that this works perfectly in IE6, I can trigger tips both in the div handling the ‘dsreadme.htm’ file and in divs in the body of the Scroller file, but in NS7 only the tips in the divs in the body of the Scroller file are shown, not those in the ‘dsreadme.htm’… Any thoughts why this is?

Thanks yet again!

4) Angus Turnbull Group: Guests
IP: 210.55.--.--
It may or may not be related, but I found a bug in Mozilla related to events being lost when you transfer content out of an IFRAME (as is done in this scroller script), and filed a bug report at this address:

http://bugzilla.mozilla.org/show_bug.cgi?id=189266

Have a read -- it seems that after you reset the location of the IFRAME used to load documents, NS/Mozilla based browsers will 'forget' any ONCLICK events that were transferred. This may also happen for tip onmouseover/onmouseout events.

So perhaps add a comment in there if you have or want a BugZilla account, as it sounds like it could be your problem too. I'm not too confident that they're getting onto it though, as it's been a month since I submitted it, and no-one at Netscape has even marked the bug as "Confirmed" yet...!

- Angus.

5) JD Group: Guests
IP: 194.47.--.--
I get what you’re saying, had to read it all a couple of times... It seems to be the same bug indeed. Don’t think I’ll make a post though, know enough to know that I know so little that I would make a total ass out of myself... Better to do it in this forum instead! ;P

At  least I get why you don’t load your sample scripts or forums, etc. directly into your site, but opens them in new windows...

6) Angus Turnbull Group: Guests
IP: 210.55.--.--
The scroller just generally doesn't mix well with dynamic content... for the forums, you can't really target a form submittal to the scrolling div, so I use new windows for most content like that.

I'll experiment a bit and see if I can find a workaround for this bug, although it doesn seem pretty deep-down in the browser.

- Angus.

7) Ami Carol Hughes Group: Guests
IP: 141.151.--.--
Me again, LOL. Umm... OK here's something that's odd. I can't get the Tips in Tipster to scroll with the page
Here's my array:

tips.TEST = new  Array(10, 'page.scrollY()', 401, 'TEXT TEXT TEXT!!');

The Link that activates this tip is in the mainDiv of the Div Scroller. It comes up. It works fine. It just won't follow the page as I scroll down. It sticks to the mainDiv and therefore scrolls off the page when you scroll down, instead of following the Y axis down so it always stays on the screen. Is there a way to make it stay put?

I hope I'm not annoying you :(

-Ami  

8) Angus Turnbull Group: Guests
IP: 210.54.--.--
Put the tip DIV and all your tip objects in the DIVSCROLL.HTML file.

Then repeat after me: "I won't put scripts in the loaded document. I won't put scripts in the loaded document. I won't put scripts in the loaded document...." :).

You  don't need the page.scrollY() variable, the whole point of the scroller is that the page doesn't scroll, only a div is moved. Remember that the scroller script is not a frame, all content loaded is merged directly with the loaded window, and hence (a) you can get away with putting all your scripts in the main scroller file, and (b) loading scripts in external files just opens up a really large can of worms.

Hope this helps - Angus.

9) Ami Carol Hughes Group: Guests
IP: 141.151.--.--
*mmmmmuah* You are *THE* Best. I put the DIV in the main document instead of the loaded one and *voila*. Well, now that everything **WORKS** and I can actually use this, I'm gonna see what I can do for a donation this weekend, hey it won't be a million bucks, but these scripts are pretty darn useful and if I use them again I'll be sure to see what I can do then as well. Not only have you done a wonderful job but you've also been a wonderful help. It's a shame ya live half a world a way, because I'd love to hang out with ya :)

Sincerely,
Ami Carol Hughes

10) Angus Turnbull Group: Guests
IP: 210.48.--.--
Glad it's solved.

And don't tell me this forum has devolved into "A/S/L??" already...? :P. Seriously, have fun in your neck of the woods!

- Angus.

11) Ami Carol Hughes Group: Guests
IP: 151.201.--.--
LOL, maybe you should make a new section in the forums for "A/S/L?" :)

In that case? 22/F/Pennsylvania, USA :P

-Aimes  <3

12) Angus Turnbull Group: Guests
IP: 139.80.--.--
Yeah! And then I'll buy really annoying popup advertisements on other sites linking to it :).

-  Angus.

13) Quest Group: Guests
IP: 192.104.--.--
Ok I have been working on getting tipster to work together and I have taken the above advice to try to get it to work but I also combined the two js files, I have removed ever thing that was double. Here is where I get my error on line 35 and that is this line here:

function LyrFn(fn, fc)
{
 LayerObj.prototype[fn] = new  Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px"; ' +
  'with  (this) { '+fc+' }');
}

any ideas why? Thanks for any help

14) Quest Group: Guests
IP: 192.104.--.--

15) Angus Turnbull Group: Guests
IP: 210.48.--.--
Wow, this got back on topic quite suddenly :).

It  would help if you told me what the error was -- that line is very generic and errors might track back to there from just about anything, so I'll assume it was the usual "sty is null or not an object". I recommend using another browser than IE for spotting errors and IE's default debugging seriously sucks, it hardly ever gets the right line anyway.

Personally I'd go back to the last known good version of the code. Errors there are usually from misnamed DIVs that can't be found, so debugging can be a pain.

- Angus.
Pages: 1 , 2 - Next > >