This is a discussion on "Help in combining two scripts" within the JavaScript Forum section. This forum, and the thread "Help in combining two scripts are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Help in combining two scripts
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hello
I have found two javascript techniques / scripts that achieve the effect I'm looking for on my page but they both make use of the mouseover event, so don't work together. I'm a javascript novice but not new to programming, I wonder if someone could advise me on the best way of combining the two scripts. One is not really a script but just a little bit of inline code which I place within a link tag:
http://www.jonathanmortimer.co.uk/te...tlinks_js.html You may notice that I'm using mousedown and mouseup instead of mouseover, this is a work around that I would rather not have to use - I would like to use just one of these (mouseover, mouseup, mousedown) to get the text and image to be replaced. Here's the swaptext javascript file: http://www.jonathanmortimer.co.uk/te...es/swaptext.js One other related question is does anyone know why javascript code would appear to cancel CSS hover in Safari? |
|
|
|
#2
|
|||
|
|||
|
Re: Help in combining two scripts
Well that swaptext script is rather huge.
I am unsure on how you would use this script but here it is anyways.
|
|
#3
|
|||
|
|||
|
Quote:
Any suggestions? Here's how I inserted it:
|
|
#4
|
|||
|
|||
|
Re: Help in combining two scripts
did you get any error messages? as that should have worked. Also post the full source code of your site
|
|
#5
|
|||
|
|||
|
Re: Help in combining two scripts
Quote:
Here's the page source:
|
|
#6
|
|||
|
|||
|
Re: Help in combining two scripts
ah its because i missread the code this is a 2 second fix The DIV was missing the ID tag, i saw the CLASS tag instead (btw you really should incase all HTML attributes in either "" or '')
here is the full code
|
|
#7
|
|||
|
|||
|
Quote:
Great! That did the trick Btw I don't suppose you know of any way to stop Firefox drawing a little dotted box around HTML <a> tagged items I click on? It kinda spoils the look of the graphics, doesn't happen in Safari. UPDATE: I discovered how to remove those annoying dotted borders around html image links. It can be removed by going to the about:config page and setting browser.display.focus_ring_width to 0. Instantly takes effect. Last edited by jonnymorris; Jul 28th, 2007 at 12:37. |
|
#8
|
|||
|
|||
|
Re: Help in combining two scripts
weird my firefox doesn't do that :S
|
![]() |
| Tags |
| combining, javascript scripts, joining, two |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| want this scripts... | skyonline | JavaScript Forum | 2 | Jun 15th, 2008 22:52 |
| Scripts | MetallicWarfare | PHP Forum | 0 | Aug 3rd, 2007 12:03 |
| Need help combining 2 Javascripts | seargentpepper7 | JavaScript Forum | 3 | Jun 11th, 2007 19:22 |
| need some scripts | habitatxskate | Web Page Design | 7 | Feb 12th, 2007 19:04 |
| Combining fixed and relative widths | hessodreamy | Web Page Design | 5 | Feb 10th, 2006 13:14 |