I am implementing a website with Djnago and i have been facing certain
issue with a javascript
i don't know if this is the right place for the post or no but if any
one can help it would be great
The problem is that when i make the path of the images :/media/images/
the image The script doesn't work but when i change it to media/images/
the image The script works fine
But i can't do make the path media/images/the image as django will not
find the image by this way so does anyone has as idea how can i make
the path of the images media/images and Django can translate it to the
right media path
here is my javascipt:
<script language="JavaScript" type="text/javascript">
<!--
if (document.media/images) {
homebutton01up = new Image();
homebutton01up.src = /"media/images/welcome.jpg";
homebutton01down = new Image() ;
homebutton01down.src = /"media/images/welcome-red.jpg";
homebutton02up = new Image();
homebutton02up.src = "/media/images/sub-scholar.jpg";
homebutton02down = new Image() ;
homebutton02down.src = "/media/images/sub-scholar_red.jpg";
homebutton03up = new Image();
homebutton03up.src = "/media/images/sub-student.jpg";
homebutton03down = new Image() ;
homebutton03down.src = "/media/images/sub-student_red.jpg";
homebutton04up = new Image();
homebutton04up.src = "/media/images/parents.jpg";
homebutton04down = new Image() ;
homebutton04down.src = "/media/images/sub-parents_red.jpg";
homebutton05up = new Image();
homebutton05up.src = "/media/images/sub-alumni.jpg";
homebutton05down = new Image() ;
homebutton05down.src = "/media/images/sub-alumni_red7.jpg";
homebutton06up = new Image();
homebutton06up.src = "/media/images/sub-donors.jpg";
homebutton06down = new Image() ;
homebutton06down.src = "/media/images/sub-donors_red.jpg";
homebutton07up = new Image();
homebutton07up.src = "/media/images/sub-career.jpg";
homebutton07down = new Image() ;
homebutton07down.src = "/media/images/sub-career_red.jpg";
}
function buttondown( buttonname )
{
if (document.media/images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.media/images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}
}
function here ( buttonname )
{
if (buttonname==homebutton01) {
document.homebutton01.src = "/media/images/welcome-red.jpg";
}
else if (buttonname==homebutton02) {
document.homebutton02.src = "/media/images/sub-scholar_red.jpg";
}
else if (buttonname==homebutton03) {
document.homebutton03.src = "/media/images/sub-student_red.jpg";
}
else if (buttonname==homebutton04) {
document.homebutton04.src = "/media/images/sub-parents_red.jpg";
}
else if (buttonname==homebutton05) {
document.homebutton05.src = "/media/images/sub-alumni_red7.jpg";
}
else if (buttonname==homebutton06) {
document.homebutton06.src = "/media/images/sub-donors_red.jpg";
}
else if (buttonname==homebutton07) {
document.homebutton07.src = "/media/images/sub-career_red.jpg";
}
}
function bye ( buttonname )
{
if (buttonname==homebutton01) {
document.homebutton01.src = "/media/images/welcome.jpg";
}
else if (buttonname==homebutton02) {
document.homebutton02.src = "/media/images/sub-scholar.jpg";
}
else if (buttonname==homebutton03) {
document.homebutton03.src = "/media/images/sub-student.jpg";
}
else if (buttonname==homebutton04) {
document.homebutton04.src = "/media/images/parents.jpg";
}
else if (buttonname==homebutton05) {
document.homebutton05.src = "/media/images/sub-alumni.jpg";
}
else if (buttonname==homebutton06) {
document.homebutton06.src = "/media/images/sub-donors.jpg";
}
else if (buttonname==homebutton07) {
document.homebutton07.src = "/media/images/sub-career.jpg";
}
}
// -->
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---