Page 1 2 3 4 

Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Honorary Mechanic
Posted
.

I have another idea to maybe solve my
vertical-sliding-banner problem.

I need a script that simply:

ScrollsDown a page...untill the page's bottom.
then ScrollsUP...untill the page's Top.
then down again...etc (endlessly)

Only adjustable thing should be the speed
px/mSec or any other...it should be able to
go very slow.

I could then place such page in a frame
to the side(s) of my Youtube-player
and that's it...i wil then have a vertical-sliding-show
I would n't mind if it could also do that horizontally

If it's difficult to detect bottom or top
it could also use some marker or maybe better number of pixels
or a direct position to scroll to (0,0),(0,2000)

It should be efficient and use as little as possible
processor-power so it will not or almost not interfere
with other dynamic things (Youtube-player) on the page.

I guess Javascript can do this,but i'm not shure if
JS is efficient on uP-power...maybe there's other
ways (languages) to do that even better ? (not Flash please)

I'm shure one of you can make that ?
seems simple...but a little to much for me.

I will be the happiest Big Grin man on earth if this
will finally solve my problem.


Radio

.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Hey Radio, you really know how to set a challenge.

I can get javascript to scroll both up and down (or left and right), the only thing I have to work out now is to change from one to the other as required.

I’m working on it.
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
.

Hi postyr,

I knew this was something unresistable for you Razz Razz

In the mean time a found something here:

http://members.chello.nl/d.bos...oll/autoscroll3.html

Funny how i ran into that today
...man-o-man have i spend weeks to find something like that.

See the source of above page for the script
i have to say it looks a little different from
what i'm used to with Javascripts...but it is very small.

Anyway i played a little with it and the result is now on my page:

HERE

patience...let it scroll to see it reverse at the end

Just what i asked...the big advantage is that this is
a real page scrolling inside that frame,so i can add everything
to it, not only pics....but also code-objects such as a clock
a chatbox or whatever...that is a lot better then just pics.
Ofcourse the continious loop in one direction was a little nicer
but this one gives me much much more options.

Only problem is again that this one also slowsdown when you start
playing the Youtube-player,not as bad as the first js one i had before
but still no good on older/slower PC's (can you confirm that once again ?)
On my new laptop no problem and all runs smooth ..but i need to take
in account visitors with older PC's(over 2 yrs ?)

Anyway i thought to have found an improvement
instead of having 2 frames (left & right)
i now made one big frame that goes all the way from
the left to the right and put 2 rows of pic's in that.
Everything you now see in the middle is over that big frame
this works ok and also gives me more control over the sync
between what happens on kleft and right-side.
Sad enough i notice nothing or almost no improvement at all
(compared to having 2 separte frames)
allthough one would expect that this would help.

The pics on the left and right side are the same...as a matter of fact
each pic is used a few times...so that improves loading-speed a lot.

I dont know how to make it better/smoother when the Youtube-player is on.

Any ideas ?
maybe a different (script)language ?
If its the uP timer being used to heavvy
i dont mind if you could construct your own timer in a script
it doesn't have to be exact

Maybe something else to improve in this script ?


Radio

.

This message has been edited. Last edited by: radiotechscan,
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
radio,

Just to give you an idea of what your animation does to a system: I have a Intel quad-core, 2.4Ghz, 8GB RAM, nVidia GeForce 9600 GT, running Win 7 64-bit. Using a system monitor, I see Firefox consuming virtually 0 CPU with a standard text web page (like this forum). When I click the link to open your page, Firefox CPU usage jumps to an average of 6%.
 
Posts: 5144 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Well there you go. A little bit of Googling can save a lot of forum posts.

But I can only agree with Larry. You are cramming to much stuff into what a user friendly page should be.

The script you have found is fine. The ones that I had developed were similar, but I couldn’t work out how to reverse the process. The one you are using works great.

When I first checked out your page, I got an error in the javascript and the scrolling didn’t work. I tried again later two or three times, and it worked fine.

My only suggestion would be that instead of having the scrolling images in the one iFrame, make two iFrames, but adjust the script in the second to work in reverse.

Just a thought.

As far as the loading process goes, you can try to pre-load the images by referencing them first in the head section of the page. This will cache the images in the browser's page buffer so it should be available immediately when the page is displayed (yet again, thanks to Larry for that suggestion in a previous thread).
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Picture of Gypsy Miles From Nowhere
Posted Hide Post
Good morning everybody;
This is probably going to sound like one of the most ridiculous snake oil sales, but I've done it a few times now and touch wood it's usually halped; options you've ever heard, but, it's worked for me with several problems in that nature. E-mail the video to yourself and then loaf it onto the page.If it doesn't work, nothing is lost and you can cross another possibility to cross off the list.
I had an online instructor whom I told about this, as I go through the whole course, print it out, but you can't (I can't save them). I posted it on the boards there. My instructor came back with, { what you mean you email them to yourself? I like the idea of being able to look over at my materials and use them as a refenence. Ha, ha,he said it was the geekiest computor .
Gypsyperformances he'd ever heard in all his time teaching. As long as the it works, I don't really care what he thinks. Naaa-a-a. I shouldn't be asking those kind 0f questons.
Gypsy
 
Posts: 46 | Location: Here | Registered: March 09, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
.

1)

Let me see if i understand this right
So Larry says it consumes (only 6%) of CPU
on opening the page...i'm not shure if he means
that that is a lot or very little,to me that
sounds like very little,specially when that is
on opening (loading) which is a heavvy part.
Maybe Larry can check that also for while the video
is playing ?


2)

So Larry does playing the video slow down the scrolling ?
i cant conclude that from your answer.


3)

I found that script by pure coincidence
a very extensive Google for scroller,script..etc
will never bring that one up.

postyr you say you agree with Larry and that there's to much on the page
...i dont understand that since 6% load dont sound much to me
so either i dont understand or there's a 0 missing from that 6 ?

Or should i see that as for the computer its not much
but "to much for a webbased-application that runs in a browser" ?

Check this page it's at Youtube itself:

http://www.youtube.com/watch?v...feature=channel_page

It shows one of my videos..click the [HD] button for max
load and quality, there's a flash-ad also and a flash-pop-up
overlayed on the video...now Larry how much does that do
on your CPU-load. more...or less then my 6% ?



4)

> "having the scrolling images in the one iFrame"

but i specificly changed that into 1 larger single frame
for the purpose to reduce uP-load..is that a wrong thought ?
(the looks/design is not the point right now)

Yes i could improve the start-up by preloading the images
but that is also not the point right now.
all i need to inprove right now is the slowing down of the scroller
while a video is playing...if i cant fix that first then the rest
(further/other improvements) wil be useless.

So i still have not solved it up to acceptable
also i'm not shure from both your responses
if you also have the scrolling frames slowing down
to unaccepatable while the Video is playing ?

Hey i'm wiling to do it different..any idea is welcome
but i need to put both the video-player and 30 banners
into this space...cant make them smaller,and each of them
should show if you dont scrolldown the mainpage.


Here's an other idea i could use instead of scrolling:

I could have a row of lets say 15 Animated Gif's
on each side of the player,where each gif consist of 5 pics
each pic shows for a few seconds...then the next...etc
So that would be a 2 rows of gif-animations (left & right-side)

or instead a image-sequencer that will cycle trough
5 pics ..and have that 15 times in a vertical row (on both sides)
(where most pics are used a few times)

Do you think that will cause less load or at least
will that animation or sequencer not slow down
when a video is shown ?



Radio

.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
.

postyr,

I have another idea that might help:

I do the scrolling for X mSec
then pause for Y mSec...etc

That might help...since no ugly scrolling
or stops might show up.
It will just give it a push lets say every
8 seconds or so.

Could you have a look if below script can be
modified for that ?
(ofcourse a different script will be fine also)


HEAD:


  
<title>Autoscroll3</title>

<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

<script type="text/javascript">

Y = 0

decreaseY = true 

window.setInterval("scroll()",60)

function scroll() {

if(Y < 0) decreaseY = false 
if(Y == (document.body.scrollHeight - document.body.clientHeight))decreaseY=true 
	
if(decreaseY) {Y = Y-1 ;window.scrollTo(0,Y)}
else {Y = Y+1 ;window.scrollTo(0,Y)}}

</script>





By the way the page editor always says:

the HTML brackets < > do not match
this is normal if the mis-matched brackets
are inside <script> tags
would you like to save this header anyway

so i say YES save...no problem with that ?
...guess not then


Radio

.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Radio, with just the scroll bars, the page is consuming about 6% of my CPU resources, when I click on a video, the usage jumps to 11% while it is loading, then jumps to about 26.5% with video playing and scroll bars moving. Is that a lot? Well, stated another way, since I have a quad-core system, your page is taking full control of one of my CPUs. If I just want to visit your page, I can afford to give up those resources. If you roughly interpolate these results, a single CPU 1.66MHz system with a standard graphics cards is going to have trouble with your page.

Most often you can ignore the "<> do not match" error message with scripts, as the check is meant for HTML/CSS code and not script. You can get around this by adding comment lines after the opening <script ...> line and before the closing </scripe> line; e.g.,
<script type="text/javascript">
<!--

put your script code here

// -->
</script>
Since you are using SSPro, you can also use a code object and use the code placement drop-down menu to put it in "Header" and you will not need the comment lines.
 
Posts: 5144 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
Ok understood the mismatch
and now i use the code-editor > in head way.

On the CPU use i'm still amazed that a scroll-action consumes so much CPU.

To make shure and since now have some reference
right now...please have a look again at the Youtube-player only and see how moch that consumes:

HERE

By the way this page uses swfobject V2.2
can you check i did that Ok ?

After that i will know more
but still dont have a good solution.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Interesting results. The YouTube video by itself is using about 13% CPU usage. When I move the mouse over the video (which triggers the overlays), usage jumps to 18%.

Your video is playing so you must have used the swfobject script correctly.
 
Posts: 5144 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
Exactly Larry,

It jumps up for as long you have the mouse over the video area (or control bar) the increased usage
is caused by the additional (partial) overlay
which needs additional calculation.
Also it activates the playlist thumbnails
that needs power also...etc.

It varies also depending on if you play in HD
(HD-button shows in red)

I just wanted to show you that the Youtube-player
itself already consumes a lot (the main part)
adding additional banners probably pushes uP-usage
over the edge of what it can handle smoothly (my old PC).

Yes i thought also that i used swfobj correctly
i used that same version 2.2 for the flash-banner
when i had that on. (gone now)

So i guess i dont have to try and waste time again
to start trying/tweaking that Flash-banner again.

In my vision a simple page-scroller in JS consumes less
then a (fancy or not) Flash-scroller...which as it seems to have turned out
also takes priority over the Youtube player (allthough they are both Flash)
and slows it down.

Can you agree with that last statement ? Roll Eyes

So we are back to one again.


Radio

.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Back to the scrolling script, I don’t think you would be able to modify the present script as once it starts, there is no way of stopping it. Actually, there may be. I’ll have a think on that.

In the meantime, I am working on another idea. I first had to try and determine the height of the page. I’ve managed to do that and set the page height to a variable, which I hope to use to manage the scrolls.

Interestingly enough, I tested my page height script in a few different browsers with a test page, and got the following results. IE8 = 1191, Firefox = 434, Opera = 440, Google Chrome = 389 and Safari = 393, all with the same page.
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
.

I dont know what you are cooking up
but maybe instead of trying to find the exact
page-height ..i guess you could instead simply
use a number of pixels for the point where it should end/reverse
...it's going to be in a frame anyway...so i have some room for
adjustments.

I could then experiment to determine the exact end-postion

I remember having seen a "scrollto(x,y)" something
that was independent from the real page size.

Anyway i played around and found:


 
window.setInterval("scroll()",60)


60 is the scroll speed...that was easy.


 

if(decreaseY) {Y = Y-1



If you there change Y-1 to Y-100
it will scroll down as usual
but when it reaches the bottom it will
go to the top in a very fast flash
and then scroll down slowly again...etc

Maybe i can help thinking if you could
translate the formulas into Human-words ?
specially this part:

  
1) if(Y < 0) decreaseY = false 
2) if(Y == (document.body.scrollHeight - document.body.clientHeight))decreaseY=true 
	
3) if(decreaseY) {Y = Y-1 ;window.scrollTo(0,Y)}
4) else {Y = Y+1 ;window.scrollTo(0,Y)}}


This is what i understand (i hope):


line 1:

If Y (the current positon) is smaller then zero then dont make it smaller
in other words stop at the top of page...is that correct ?

line 2: Some other action if line 1 is not true & Get the page height ?

line 3: If bottom was reached turn around and scroll up ?
line 4: Otherwise increase current position (Y) by 1 ?


I'm mostly guessing ofcourse...and i couldn't modify it
myself other then by trial and error.

All i know is what i remember from my Tandy TRS80
it used the very simple language "BASIC"
that must have beem somewhere in the 70's Wink

Lets say you would:
1) Make it scroll 500 px each time (by using Y = Y+500 ?)
2) Pause X mSec
3) Untill Y is more (or equal) then Z
(where Z is a position in px,not the difficult to determine page-height)

Then the same in upwards direction.

The idea is that in that case it might not look ugly
cause the scrolling is done in pieces of one fast (500 px) move
if it waits a little longer to do that then that seems
not a problem.


Radio

.
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Radio,

You are partially correct. Early in the piece I toyed with the same configurations, but it simply won’t work.

To delay the script at certain times, such as 8 seconds, you need to clear a “setTimeOut” or “setInterval”

The initial script does not have (nor need) neither setTimeOut or setInterval. When you try to apply either, all it does is speed up the process, because it repeats the same function every specified period.

In other words, once the script has started, there is no way of calling a “clearTimeOut” or”clearInterval” without user input. So the script will keep running.

Your thought on number 2 about getting the page height may be correct. But, I am using my script to obtain an actual value of the page height (an integer). That way (hopefully), I can use that integer to reduce the actual figure until it reaches zero to switch to a scroll up function (and visa versa).

The problem there is performing the “clears” inside an actual function, without user input.

Your first suggestion about using a number of pixels wouldn’t work either. From my earlier post, you will see that the pixel length of a page varies on different browsers.

“BASIC”. That brings back memories.

Yes, I too had an old Tandy (though it wasn’t old at the time) and used to do heaps of things I can’t do now.

As a matter of fact, our company currently still use an ERP system developed by Hewlett Packard. It uses coding very similar to BASIC and I often give our IT department assistance. We are changing over to a new system in about six months called Lawson. Never heard of them, but I presume that an upgrade is a step forward. Especially in these economic times.
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
postyr, this site may help you decide which DOM property to use to determine page height. I have found his site invaluable in detailing the quirks between the various browsers.
 
Posts: 5144 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Radio,

I really don’t think you are going to achieve anything by stopping and starting the script. Besides the fact it would affect the effect (?), I’m sure it is other content of your page that is causing the rise in CPU usage.

My system is similar to Larry’s. Intel quad-core 2.33Ghz, nVidia GeForce 9500 GT, still using Win XP, but only have half of his RAM (4GB), and am getting pretty well the same results.

I personally don’t think the scrolling script is adding anything (or very little) to the CPU usage. As a test, I used the script on a page with 40 images, and the page was 5000 pxs long. My normal CPU usage is 3-5% (I have a few apps running in the background). While the script was running, it was using 4-6%, only an increase of 1%.

You can test the CPU usage yourself. In Windows, press CTL, ALT, Delete. That will bring up the Windows Task Manager. Click on the Performance tab, and it will display the CPU usage. The Task Manager will stay on top of all other windows unless you minimize it to the task bar.

By the way Larry, thanks for the link, very helpful.
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Picture of Gypsy Miles From Nowhere
Posted Hide Post
THIS IS AN SOS FOR TERRY; I am sorry for using it here, but I believe he's in here somewhere.

Hello Terry, how do I get that page down to work on it and add a couple of things, but no luck.
Gypsy
 
Posts: 46 | Location: Here | Registered: March 09, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Posted Hide Post
postyr,

Lets reply at the end.

Yes i know how how to work with "Windows Task Manager"
and i also have 3 different PC's so i can perfectly see
the bahaviour and loads under various circumstances
for various PC's.

It's a mix of various things...it will be very hard
to exactly pinpoint..but in the end all that counts
is the result.

Let me resume again:


I make a page with only the Youtube-player
i let it play under the haevviest circumstance
which is to have it play a HD-video.

A HD-video uses more processor power,more cache
and more bandwidth...to make it go in HD
you need a HD-video and press the HD-button
which will then go red (instead of grey)
if the HD-button is red already then it does already
play in HD.

I have to add that incase you dont have a fast connection
that Youtube will not issue the video in HD-format
but in some lower quality...in such case you will not
see my problem as i or others do.
so you have to make shure that the HD-button is indeed RED



1)

A page with only a Youtube-player playing in HD-mode
and nothing else on that page:

WILL RUN FINE and SMOOTH on all Pc's (old to new)



2)

A page with only the scroller on it:
nomatter what type (JS or Flash)

WILL RUN FINE and SMOOTH on all PC's


3)

A page with BOTH the Youtube-player and a scroller on it:

WILL NOT RUN SMOOTH on older PC's


So what else can i conclude then...
having both causes some to-much load effect ?

Yes for best solution it would be nice to exactly know where this
is coming from...but i guess that is to complicated for us
and in the end whe can not do much else then trying to
workaround it.

In case of a Flash-scroller it ruins the Youtube-player
In case of a JS-scroller the Youtube-player ruins the scroller
and makes it slow down to ugly...or fullstop.


Up to now the unwanted effect is the least when i use
the current scroller (in-frame-scroller)
The Youtube player plays fine and is not affected.

Since the current script is doing a 1 px by 1 px scroll-action,
any to much load shows up immidiatly as a non-smooth movement.

My idea to have it instead do larger jumps at once of lets say 5 pics (280 px)
and then have it pause for lets say 10 seconds ...seems to solve the
problem of having to look at a ugly movement.
In the worse case it might slowdown the pause-time but i guess it will then still
sooner or later jump to a next position...i imagine that to be acceptable.

The jumping it self will (when using the current but modified script)
appear as a very fast scroll and not as a sudden image-switch.
therefore it still gives some interesting dynamic effect.


So my guess is that it is worth to try to change the current script
to having it jump 280 px at once...followed by a 10 sec pause.

I hope i have put it in the right words...and did not forget anything.

What do you think ?


Radio

.

This message has been edited. Last edited by: radiotechscan,
 
Posts: 1054 | Registered: February 27, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
I think I have the answer for you.

I’m off to work right now, but when I get the chance, I will do a little further testing then let you know how I go.
 
Posts: 1165 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community Page 1 2 3 4  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.