TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 88
  • Total: 88

question about javascript sticky content and how to adjust it

Started by elliel, February 18, 2006, 07:32:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

elliel

I have a javascript I want to use in a block, but it is 200px wide and I am using blocks that are 150 wide

The javascript comes from a writing site and displays a list of contests.  I used to have it on my website where 200px was ok but its not ok for the blocks as it spreads outside the block box  :(

I copied the script and opened it and there you can adjust the width but now I dont know what to do to get it working in a block

Does anyone know what to do with this? Or if you can somehow force it stay within the block?

~thanks


G6Cad

You can always change the witdh of your blocks in TPadmin/manage Blocks.

But it would be easyer to see if you could point to the script or paste in the code so BorgBob or someother code buster could have a look at it ?

elliel

I dont want my blocks any wider or they squash up the forum too much but I did copy the code.

Then I edited the width but since the javascript gets its data from its own site, I dont think my edits will take effect

My block width is 150

here is the javascript code

the file is called contestsmarquees.js

from the page I mentioned above

I tried changing the width from 200 to 120 but it still didnt work in my block

<code removed>

G6Cad



The "200" is the figure to laborate with, You have your blocks set to 150, so 148 or 146 should do the trick

Sorry, but that dident seem to be right though..
Dont quite understand why...... borgBoB can perhaps give us a clue?

elliel

yeah I know, I tried to change it but it doesnt seem to want to co-operate lol

bloc

The js file you modified..did you link correctly to that? your own copy?

elliel

Im not quite sure what to do to the file I modified, as if I save it, and then point to 'my file' will it still be able to update the content from the original file?

Tucker

ou have to upload your modified version to your webspace into a certain directory (perhaps a new directory /scripts/ in the root of your webspace). Se cond you have to correct the second link in the inserted text
<script language="javascript" src="http://www.oncewritten.com/Scripts/WritingContestsVars.js">
</script>
       
<script language="javascript" src="http://www.oncewritten.com/Scripts/WritingContestsMarquee.js">
</script>

to match it your new uploaded script, something like

src="http://www.yoursite.com/scripts/WritingContestsMarquee.js"


It works, just look at this simple Test  ;)

elliel

wow, cool

will that keep updating content from the site that it comes from ie the oncewritten site, even though its now loaded on my site?

(sorry if this is a dumb question)

Tucker

Yes, it will. Because the data is retrieved on their server and "sent"/brought to your client/browser by the first script in the inserted text.

No question is dumb!

This website is proudly hosted on Crocweb Cloud Website Hosting.