iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-11-2008, 08:28 PM
WebProWorld New Member
 
Join Date: Jul 2003
Location: Portland, Oregon
Posts: 14
graphyx RepRank 0
Default Java Script Question

I have a question that I hope has an answer. I'm working on a website project which I can't talk about until the project is launched, but, my client wants to have all of the buttons on the page push when the mouse is clicked (rollover down) and that is generated in Java Script. Now he also wants to include a live news ticker on one of the pages.

My problem is that this is also Java Script and the instructions for the news ticker say to put it between the header tags which is where the script for the buttons lives. So on my pages without the news ticker the buttons light up and push just as they are supposed to. But when I paste in the news ticker script it cancels out the movement of the buttons. The links still work but the buttons no longer push. The news ticker works just fine but the buttons are now static. I am a graphic designer and not a programmer so I have no idea if there is something I can do to alleviate this problem. Is there a simple fix for this situation.

Thank you,
David Griffith
david@graphyx.com
503.254.8312

Graphyx Media Design and Digital Illustration

<head>
<title>Welcome To xxxxxxx.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ImageReady Preload Script (NewFront1f-1.psd) -->
<script type="text/javascript">
<!--

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
home_down = newImage("images/home-down.jpg");
about_ann_down = newImage("images/about-ann-down.jpg");
conservative_issues_down = newImage("images/conservative-issues-down.jpg");
faq_down = newImage("images/faq-down.jpg");
web_security_down = newImage("images/web-security-down.jpg");
contact_us_down = newImage("images/contact-us-down.jpg");
subscribe_down = newImage("images/subscribe-down.jpg");
american_news_down = newImage("images/american-news-down.jpg");
american_blogs_down = newImage("images/american-blogs-down.jpg");
conservative_editorials_down = newImage("images/conservative-editorials-dow.jpg");
veterans_assistance_down = newImage("images/veterans-assistance-down.jpg");
terrorism_watch_down = newImage("images/terrorism-watch-down.jpg");
christian_resources_down = newImage("images/christian-resources-down.jpg");
preloadFlag = true;
}
}

// -->
</script>


<script language="javascript">

//Specify the marquee's width (in pixels)
var marqueewidth="300px"

//Specify the marquee's height
var marqueeheight="200px"

//Specify the marquee's speed (larger is faster 1-10)
var marqueespeed=1

//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Absolute positioning
var yCoord=400
var xCoord=200

</script>
Reply With Quote
  #2 (permalink)  
Old 09-12-2008, 08:28 PM
james113's Avatar
WebProWorld Pro
 
Join Date: Jun 2004
Location: Hillsboro, Illinois
Posts: 145
james113 RepRank 2
Default Re: Java Script Question

I would try taking the first javascript out and placing it in an external .js file and link to it from the head section of each page like this:

1. Copy and paste this portion of your javascript into a text file with any text editor and save as newJSfile.txt:


function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
home_down = newImage("http://www.webproworld.com/images/home-down.jpg");
about_ann_down = newImage("http://www.webproworld.com/images/about-ann-down.jpg");
conservative_issues_down = newImage("http://www.webproworld.com/images/conservative-issues-down.jpg");
faq_down = newImage("http://www.webproworld.com/images/faq-down.jpg");
web_security_down = newImage("http://www.webproworld.com/images/web-security-down.jpg");
contact_us_down = newImage("http://www.webproworld.com/images/contact-us-down.jpg");
subscribe_down = newImage("http://www.webproworld.com/images/subscribe-down.jpg");
american_news_down = newImage("http://www.webproworld.com/images/american-news-down.jpg");
american_blogs_down = newImage("http://www.webproworld.com/images/american-blogs-down.jpg");
conservative_editorials_down = newImage("http://www.webproworld.com/images/conservative-editorials-dow.jpg");
veterans_assistance_down = newImage("http://www.webproworld.com/images/veterans-assistance-down.jpg");
terrorism_watch_down = newImage("http://www.webproworld.com/images/terrorism-watch-down.jpg");
christian_resources_down = newImage("http://www.webproworld.com/images/christian-resources-down.jpg");
preloadFlag = true;
}
}

2. Upload newJSfile.txt to your website.

3. Rename the file to newJSfile.js

4. Then add the code below between the <head> tags to link to your new external javascript file:


<script type="text/javascript" src="http://www.YourSite.com/newJSfile.js"></script>





Upright Headstones
__________________
James Allen

Last edited by james113; 09-12-2008 at 08:37 PM.
Reply With Quote
  #3 (permalink)  
Old 09-12-2008, 09:18 PM
Web-Design-Guy's Avatar
WebProWorld Pro
 
Join Date: Jun 2008
Location: Perth, Western Australia
Posts: 110
Web-Design-Guy RepRank 1
Default Re: Java Script Question

I would suggest (actually, strongly recommend) defining the different button states using css (external file also) instead of js.
Reply With Quote
  #4 (permalink)  
Old 09-13-2008, 12:36 AM
ron angel's Avatar
WebProWorld Veteran
 
Join Date: Jan 2004
Location: london uk
Posts: 336
ron angel RepRank 2ron angel RepRank 2
Lightbulb Re: Java Script Question

This may not be very helpful but may I suggest to your clients to dump the news ticker. The reason being it is distracting them from the site, the thing you want them to look at & stay on.Its a bit like putting a link to you oppositions site! If something big happens in the world they will go to see the story & may not come back! unless it is of great importance to the site of course because of the sites purpose & content..... I suppose if you must have it maybe at the bottom of the page.
__________________
historical information links re uk and usa
http://www.ssrichardmontgomery.com
Reply With Quote
  #5 (permalink)  
Old 09-13-2008, 01:39 AM
WebProWorld New Member
 
Join Date: Jul 2003
Location: Portland, Oregon
Posts: 14
graphyx RepRank 0
Default Re: Java Script Question

Thank all of you and I will try them including the last of excluding the news ticker . . . thank you again.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Script in FireFox matheen Graphics & Design Discussion Forum 1 03-24-2007 11:43 AM
Java script in navigation bar for SEO amar Search Engine Optimization Forum 14 10-05-2005 03:19 AM
Yahoo and Java Script pabloroberto Yahoo! Discussion Forum 1 12-23-2004 01:03 PM
Compatible Java Script? C French Web Programming Discussion Forum 1 11-11-2004 02:54 PM
The Ghost Java Script!! Txarán Web Programming Discussion Forum 3 06-15-2004 11:46 AM


All times are GMT -4. The time now is 03:51 PM.



Search Engine Optimization by vBSEO 3.3.0