|
 |
|
|
12-28-2008, 01:54 PM
|
Image Repeat Problem
|
Posts: 4
|
Ok so here is the webpage http://www.jmajhomeschoolacademy.com/articles.html on the sides you will notice that my little message boxes repeat. I do not want this I want there to only be one on each side. Here is the entire code for it, i am not sure where the mistake is at. I am new to Java so please no insults. I am learning and that is why I am asking for help. thanks in advance.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<title>JMAJ Homeschool Academy Article's</title>
<style
type="text/css"> <!-- A:link { text-decoration: none; color:#YourColor
}}} A:visited { text-decoration: none; color:#YourColor }} A:hover { text-decoration:
none; color:#ffff40 ;}
BODY{background-attachment : fixed;} -->
body {
scrollbar-arrow-color: white;
scrollbar-base-color: #512019;
scrollbar-dark-shadow-color: black;
scrollbar-track-color: #44644a;
scrollbar-face-color: black;
scrollbar-shadow-color: white;
scrollbar-highlight-color: silver;
scrollbar-3d-light-color: black;
}
-->
</style>
<SCRIPT language="JavaScript">
// HpbImgPreload:
//
function HpbImgPreload()
{
var appVer=parseInt(navigator.appVersion);
var isNC=false,isN6=false,isIE=false;
if (document.all && appVer >= 4) isIE=true; else
if (document.getElementById && appVer > 4) isN6=true; else
if (document.layers && appVer >= 4) isNC=true;
if (isNC||isN6||isIE)
{
if (document.images)
{
var imgName = HpbImgPreload.arguments[0];
var cnt;
swImg[imgName] = new Array;
for (cnt = 1; cnt < HpbImgPreload.arguments.length; cnt++)
{
swImg[imgName][HpbImgPreload.arguments[cnt]] = new Image();
swImg[imgName][HpbImgPreload.arguments[cnt]].src = HpbImgPreload.arguments[cnt];
}
}
}
}
// HpbImgFind:
//
function HpbImgFind(doc, imgName)
{
for (var i=0; i < doc.layers.length; i++)
{
var img = doc.layers[i].document.images[imgName];
if (!img) img = HpbImgFind(doc.layers[i], imgName);
if (img) return img;
}
return null;
}
// HpbImgSwap:
//
function HpbImgSwap(imgName, imgSrc)
{
var appVer=parseInt(navigator.appVersion);
var isNC=false,isN6=false,isIE=false;
if (document.all && appVer >= 4) isIE=true; else
if (document.getElementById && appVer > 4) isN6=true; else
if (document.layers && appVer >= 4) isNC=true;
if (isNC||isN6||isIE)
{
if (document.images)
{
var img = document.images[imgName];
if (!img) img = HpbImgFind(document, imgName);
if (img) img.src = imgSrc;
}
}
}
var swImg; swImg=new Array;
//-->
</SCRIPT><SCRIPT language="JavaScript">
<!--HPB_SCRIPT_PLD_50
HpbImgPreload('_HPB_ROLLOVER1', 'http://i438.photobucket.com/albums/qq108/leighahoffner/1oven_home_off.jpg',
'http://i438.photobucket.com/albums/qq108/leighahoffner/1oven_home_on.jpg');
HpbImgPreload('_HPB_ROLLOVER2', 'http://i438.photobucket.com/albums/qq108/leighahoffner/2oven_aboutus_off.jpg',
'http://i438.photobucket.com/albums/qq108/leighahoffner/2oven_aboutus_on.jpg');
HpbImgPreload('_HPB_ROLLOVER3', 'http://i438.photobucket.com/albums/qq108/leighahoffner/3oven_product_off.jpg',
'http://i438.photobucket.com/albums/qq108/leighahoffner/3oven_product_on.jpg');
HpbImgPreload('_HPB_ROLLOVER4', 'http://i438.photobucket.com/albums/qq108/leighahoffner/4oven_gallery_off.jpg',
'http://i438.photobucket.com/albums/qq108/leighahoffner/6oven_contact_on.jpg');
HpbImgPreload('_HPB_ROLLOVER7', 'http://i438.photobucket.com/albums/qq108/leighahoffner/7oven_links_off.jpg',
'http://i438.photobucket.com/albums/qq108/leighahoffner/7oven_links_on.jpg');
//-->
</SCRIPT></HEAD>
<BODY background="http://i438.photobucket.com/albums/q...er/oven_bg.jpg" text="#000000" bgcolor="#ffffff"
link="#009900" alink="#009900" vlink="#009900" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<CENTER>
<TABLE cellspacing="0" cellpadding="0" style="border-top-width : thick;border-right-width : thick;border-bottom-width :
thick;border-left-width : thick;border-style : none solid solid;border-left-style : solid;border-color : black black black
black;">
<TBODY>
<TR>
<TD td background="http://i438.photobucket.com/albums/q...ven_image4.jpg" width="1197" height="375"
align="center" valign="top"><BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<TABLE>
<TBODY>
<TR>
<TD height="87" width="642" align="center"></TD>
<TD align="center" height="87" width="392"><SCRIPT LANGUAGE="JavaScript">
<!-- Web Site: http://kylo.ml.org/flash -->
<!-- Begin
var speed = 100;
var cycledelay = 2000;
var maxsize = 40;
var x = 0;
var y = 0;
var themessage, size;
var esize ="</font>";
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var themessage2 = new initArray(
"<B>Welcome to</B>",
"<B>Our Offical Site</B>",
"<B>JMAJ Homeschool Academy</B>",
"<B>Enjoy Your Visit </B>!"
);
if(navigator.appName == "Netscape")
document.write('<layer id="wds"></layer><br>');
if (navigator.appVersion.indexOf("MSIE") != -1)
document.write('<span id="wds"></span><br>');
function upwords(){
themessage = themessage2[y];
if (x < maxsize) {
x++;
setTimeout("upwords()",speed);
}
else setTimeout("downwords()",cycledelay);
if(navigator.appName == "Netscape") {
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
wds.innerHTML = "<center>"+themessage+"</center>";
wds.style.fontSize=x+'px'
}
}
function downwords(){
if (x > 1) {
x--;
setTimeout("downwords()",speed);
}
else {
setTimeout("upwords()",cycledelay);
y++;
if (y > themessage2.length - 1) y = 0;
}
if(navigator.appName == "Netscape") {
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
wds.innerHTML = "<center>"+themessage+"</center>";
wds.style.fontSize=x+'px'
}
}
setTimeout("upwords()",speed);
// End -->
</script></TD>
<TD height="87" width="82"></TD>
</TR>
</TBODY>
</TABLE>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</TD>
</TR>
<TR>
<TD style="border-top-width : thin;border-bottom-width : thin;border-style : solid none solid none;border-top-color :
black;border-bottom-color : black;" background="http://i438.photobucket.com/albums/q...en_menu_bg.jpg"
align="center">
<TABLE>
<TBODY>
<TR>
<TD><A href="http://www.jmajhomeschoolacademy.com/" id="_HPB_ROLLOVER1" onmouseout="HpbImgSwap('_HPB_ROLLOVER1',
'1oven_home_off.jpg');" onmouseover="HpbImgSwap('_HPB_ROLLOVER1',
'http://i438.photobucket.com/albums/qq108/leighahoffner/1oven_home_on.jpg');"><IMG
src="http://i438.photobucket.com/albums/q...n_home_off.jpg" width="77" height="46" border="0"
name="_HPB_ROLLOVER1"></A></TD>
<TD>~</TD>
<TD><A href="http://www.jmajhomeschoolacademy.com/leighahome.html" id="_HPB_ROLLOVER2"
onmouseout="HpbImgSwap('_HPB_ROLLOVER2', 'http://i438.photobucket.com/albums/qq108/leighahoffner/2oven_aboutus_off.jpg');"
onmouseover="HpbImgSwap('_HPB_ROLLOVER2',
'http://i438.photobucket.com/albums/qq108/leighahoffner/2oven_aboutus_on.jpg');"><IMG
src="http://i438.photobucket.com/albums/q...boutus_off.jpg" width="135" height="47" border="0"
name="_HPB_ROLLOVER2"></A></TD>
<TD>~</TD>
<TD><A href="http://www.jmajhomeschoolacademybookstore.ecrater.com/" id="_HPB_ROLLOVER3"
onmouseout="HpbImgSwap('_HPB_ROLLOVER3', 'http://i438.photobucket.com/albums/qq108/leighahoffner/3oven_product_off.jpg');"
onmouseover="HpbImgSwap('_HPB_ROLLOVER3',
'http://i438.photobucket.com/albums/qq108/leighahoffner/3oven_product_on.jpg');"><IMG
src="http://i438.photobucket.com/albums/q...roduct_off.jpg" width="200" height="49" border="0"
name="_HPB_ROLLOVER3"></A></TD>
<TD>~</TD>
<TD><A href="http://www.jmajhomeschoolacademy.com/submit.html" id="_HPB_ROLLOVER6"
onmouseout="HpbImgSwap('_HPB_ROLLOVER6', 'http://i438.photobucket.com/albums/qq108/leighahoffner/6oven_contact_off.jpg');"
onmouseover="HpbImgSwap('_HPB_ROLLOVER6',
'http://i438.photobucket.com/albums/qq108/leighahoffner/6oven_contact_on.jpg');"><IMG
src="http://i438.photobucket.com/albums/q...ontact_off.jpg" width="189" height="48" border="0"
name="_HPB_ROLLOVER6"></A></TD>
<TD>~</TD>
<TD><A href="http://www.jmajhomeschoolacademy.com/ads.html" id="_HPB_ROLLOVER7"
onmouseout="HpbImgSwap('_HPB_ROLLOVER7', 'http://i438.photobucket.com/albums/qq108/leighahoffner/7oven_links_off.jpg');"
onmouseover="HpbImgSwap('_HPB_ROLLOVER7', 'http://i438.photobucket.com/albums/qq108/leighahoffner/7oven_links_on.jpg');"><IMG
src="http://i438.photobucket.com/albums/q..._links_off.jpg" width="96" height="49" border="0"
name="_HPB_ROLLOVER7"></A></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR>
<TD align="center" background="http://i438.photobucket.com/albums/q..._middle_bg.jpg" width="1197"
height="648">
<TABLE>
<TBODY>
<TR>
<TD width="327"></TD>
<TD width="356"></TD>
<TD align="center" width="469"><SCRIPT language=Javascript1.2>
<!--
var tags_before_clock = "<p align='right'><b><font face='verdana' size='1' color='black'>"
var tags_middle_clock = "at"
var tags_after_clock = "</font></b></p>"
if(navigator.appName == "Netscape") {
document.write('<layer id="clock"></layer><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="clock"></span>');
}
DaysofWeek = new Array()
DaysofWeek[0]="Sunday - "
DaysofWeek[1]="Monday - "
DaysofWeek[2]="Tuesday - "
DaysofWeek[3]="Wednesday - "
DaysofWeek[4]="Thursday - "
DaysofWeek[5]="Friday - "
DaysofWeek[6]="Saturday - "
Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"
function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()
var col = ":";
var spc = " ";
var com = ",";
var apm;
if (date == 1 || date == 21 || date == 31)
{ender = "st"}
else
if (date == 2 || date == 22)
{ender = "nd"}
else
if (date == 3 || date == 23)
{ender = "rd"}
else
{ender = "th"}
if (12 < hrs) {
apm="<font size='1'> pm</font>";
hrs-=12;
}
else {
apm="<font size='1'> am</font>";
}
if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;
if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+day+month+hrs+col+min+col+sec+apm+spc+tags_middle_clock+spc+day+spc+month+spc
+date+ender+spc+year+tags_after_clock);
document.clock.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML =
tags_before_clock+day+month+spc+date+ender+spc+year+spc+tags_middle_clock+spc+hrs+col+min+col+sec+apm+spc+tags_after_clock;
}
}
setInterval("upclock()",1000);
//-->
</SCRIPT>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE border="1">
<TBODY>
<TR>
<TD width="332"></TD>
<TD width="514"></TD>
<TD width="306"></TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="1172">
<TBODY>
<TR>
<TD height="282" background="http://i438.photobucket.com/albums/q...essage_box.jpg"
width="273"><p align="center">Welcome and enjoy the site!<p><p align="center">From our family to yours!<p></TD>
<TD height="282" width="617" valign="top" align="center">Welcome to JMAJ Homeschool Academy's Articles.</p>
Welcome to our article's page. We hope that this page will let you know what we do and how we do it along with
much more information.</p>
<BR>
We have a very unique structure when it comes to the kids. They are all different people, with their own learning
styles. We have taylored their studies to how they learn best. Although there are times that they don't like it, the
information that we want to teach them is retained better.</p>
For Jessica she is using a flashcard program called Free World U that allows here to here opera music while she
works. The program helps her to better understand the material by showing her pictures that she can associate with what she
is learning. Jessica works very hard and is an Honor Roll student. She does at least 3 units a day in each subject along with
3 units or more a day in religion. However, most days she doubles that. Jessica is currently doing Math, English, Social
Studies, Science, Arts, ASL, Spanish, and Religion.</p>
Amir is working out of textbooks. Amir is very smart and although he loves the pictures on the flashcard system he
does not retain the information very well that way. With the textbooks he is able to look at all the information and use it
as a refresher when he needs it. Amir is currently only doing the subjects of Math, English, Social Studies, Science, and the
Arts. </p>
Jamil is working on ASL. Being only two and a half, and all his special needs right now he is developing ASL
skills so that I can homeschool him next year. This year we are focusing on his health and his therapies so that he can get
stronger and be able to learn. Hopefully it won't be long. The ASL is working for him and he is doing really well for a child
with such extensive needs.</p>
Right now I am currently enrolled at Kaplan University. I am going into my 4th term with a 4.0 GPA. I am also a
web designer, CPA, mother, wife, and business owner. My husband Baron is also a business owner. He is also a workaholic. We
believe that homeschooling is way better than any education that the Chicago Public School system can give. As Muslims we
also believe that teaching our children religious material can only be done in the home, the schools would never teach Islam
to our children and if they do it would be that Muslims are all terrorists. Which we are not.</p>
</TD>
<TD background="http://i438.photobucket.com/albums/q...essage_box.jpg" width="260"
height="282" align="center"><BR>
<BR>
<script type="text/javascript">
/***********************************************
* Pausing updown message scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//configure the below five variables to change the style of the scroller
var scrollerdelay='3000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='120px'
var scrollerheight='195px'
var scrollerbgcolor=''
//set below to '' if you don't wish to use a background image
var scrollerbackground='scrollerback.gif'
//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<font face='Arial'><a href='http://www.jmajhomeschoolacademy.com/'>Welcome to JMAJ Homeschool
Academy</a></font>"
messages[1]="<font face='Arial'><a href='http://www.jmajhomeschoolacademybookstore.ecrater.com/'>Check out This Weeks Special
!!</a></font>"
messages[2]="<font face='Arial'><a href='http://www.blog.jmajhomeschoolacademy.com/'>Read our Blog to find out what's
happening with us !</a></font>"
messages[3]="<font face='Arial'><a href='http://www.jmajhomeschoolacademy.com/ads.html'>Check out our new
sponsors!</a></font>"
messages[4]="<font face='Arial'><a href='http://www.jmajhomeschoolacademy.com/submit.html'>Send us your ideas, comments, or
concerns....Enjoy your stay!</a></font>"
///////Do not edit pass this line///////////////////////
var ie=document.all
var dom=document.getElementById
if (messages.length>2)
i=2
else
i=0
function move(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move(tdiv)",scrollerdelay)
setTimeout("move2(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move(tdiv)",50)
}
else{
tdiv.style.top=parseInt(scrollerheight)+"px"
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
tdiv2.style.top=0+"px"
setTimeout("move2(tdiv2)",scrollerdelay)
setTimeout("move(first2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
setTimeout("move2(second2_obj)",50)
}
else{
tdiv2.style.top=parseInt(scrollerheight)+"px"
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
first2_obj=ie? first2 : document.getElementById("first2")
second2_obj=ie? second2 : document.getElementById("second2")
move(first2_obj)
second2_obj.style.top=scrollerheight
second2_obj.style.visibility='visible'
}
if (ie||dom){
document.writeln('<div id="main2"
style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor
+' ;background-image:url('+scrollerbackground+')">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0
'+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
if (window.addEventListener)
window.addEventListener("load", startscroll, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroll)
else if (ie||dom)
window.onload=startscroll
</script></TD>
</TR>
<TR>
<TD></TD>
<TD align="center"><BR>
More Articles<BR>
<BR>
<BR>
<TABLE>
<TBODY>
<TR>
<TD background="http://i438.photobucket.com/albums/q...ll_testbox.jpg" width="185"
align="center" style="border-width : thin thin thin thin;border-style : solid solid solid solid;border-color : white black
black white;" height="133">New term grades available <BR>
<a href="http://www.jmajhomeschoolacademy.com/grades.html">Here</a></TD>
</TR>
</TBODY>
</TABLE>
<BR>
Please come and visit us daily as we add things everyday!<BR>
<BR>
<BR>
</TD>
<TD></TD>
</TR>
</TBODY>
</TABLE>
<BR>
<BR>
<TABLE>
<TBODY>
<TR>
</TR>
</TBODY>
</TABLE>
<BR>
<FONT size="-2">Credits<BR>
Graphic Design By Leigha Hoffner</A></FONT><FONT size="-1"><BR>
<BR>
</FONT><BR>
</TD>
</TR>
</TBODY>
</TABLE>
</CENTER>
</BODY>
</HTML>
|
|
|
|
12-28-2008, 02:11 PM
|
Re: Image Repeat Problem
|
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
You aren't having a JavaScript problem (note that Java is not the same as JavaScript BTW), you are having an HTML/CSS problem. Before you start learning too much about JS, I would take the time to study HTML and CSS more completely. Backgrounds repeat by default, and should be specified inside of CSS instead of with the deprecated background="" attribute. You can make backgrounds not repeat inside of a CSS document like this:
CSS
Code:
.mybackgroundclass {
background: url(/images/mybackground.gif) top left no-repeat;
}
Cheers.
|
|
|
|
|
« Reply to Image Repeat Problem
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|