PDA

View Full Version : hello: why noone does reply? Am i doing something wrong...please give some answer.



sharmin
08-02-2006, 07:07 PM
1) Script Title: Tree Menu Help

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

3) Describe problem: I want the active link to have different color or symbol so that user can know, which page they are in, while they visit that web page.

Hello,

hello: why noone does reply? Am i doing something wrong...please give some answer.

I have posted this message yesterday at this forum; noone is replying..Why?
Please let me know. However the whole message is at below:

I am using DD's tree menu in a webpage as a template. The menu is great, but I cannot modify the java or the css file of DD, as I am not sure how to do it.

I need help in order to acheive the following modification:

Whenver a link will be pressed at DD tree menu, it will not only go to that page but, will, also, that specific link, have a different color or size or image, as long as that link were open.

I am giving the zip file. The template file's name is:testing.dwt, which can be read by Dreamweaver or by wordpad or by notepad. The 4 dummy webpages are: page1.htm, page2.htm, page3. htm, page4.htm.

Please give some suggestions and help, as I have tried allready, so that links could be visible when they remain active( as long as a link were open).

Only the attachment is attached with yesterday's post, where the demo is.
Thanks in advance.

jr_yeo
08-02-2006, 07:39 PM
hello: why noone does reply? Am i doing something wrong...please give some answer.
no ur not doing something wrong as per DD forum rules go :D but a lot of the guyz here have busy schedules :) they can't answer everything all at once. have patience.

mburt
08-02-2006, 08:40 PM
Okay. This makes four links, with the id tags "page1" "page2" "page3" etc..

When the window loads, it checks the filename, and if the file name is "page1.htm" the corresponding link lights up, in "red".


<html>
<head>
<script>
onload=function() {
var url = document.location.href
var theChar
for (i = 0;i <= url.length;i++) {
if (url.charAt(i) == "/") {theChar = i}
}
var full = url.substring(theChar + 1,url.length)
if (url.charAt(url.length - 1) == "/") {full = url + "(unknown filetype)"}
if (full=="page1.htm") {page1.style.color="red"}
if (full=="page2.htm") {page2.style.color="red"}
if (full=="page3.htm") {page3.style.color="red"}
if (full=="page4.htm") {page4.style.color="red"}
}
</script>
</head>
<body>
<a href="#" id="page1">Page 1</a>
<br><a href="#" id="page2">Page 2</a>
<br><a href="#" id="page3">Page 3</a>
<br><a href="#" id="page4">Page 4</a>
</body>
</html>

mburt
08-02-2006, 08:46 PM
Online example:

http://www40.brinkster.com/mburt/scripts/page1.htm

Girard Ibanez
08-02-2006, 09:04 PM
Gee ... I have a similar post on the css section and dynamic link section.

Great ... now we can solve two folk issues..

Girard Ibanez
08-02-2006, 09:12 PM
Mike got the idea I also need ....gonna try his js tonight ....:)
--------------------------------------------------------------------------------

Need help on a way to highlight the navigation hyper links when page is active.


Here's the link to my site:

http://team-raptor.net/girard/myrapt...servo_tip.html

Two problems to solve same issue.

problem 1:
Left vertical nav menu "collective servo" left column.... need it to change color/bold text when page is active or shown on right column.

problem 2:
Top horizontal nav menu ... building tips >> raptor 50V2 >> collective servo

when click will also highlight/bold text left nav menu for collective servo.


Thanks,


girard

sharmin
08-02-2006, 11:30 PM
Online example:

http://www40.brinkster.com/mburt/scripts/page1.htm


Hello Mburt,

thank you.

It is working now both in ie and in ff. i have more questions: if i want to make the font-size bold with having red color or if i want to upload a new image for the active link, what should I do?

i tried the following approaches:

<script>
onload=function() {
var url = document.location.href
var theChar
for (i = 0;i <= url.length;i++) {
if (url.charAt(i) == "/") {theChar = i}
}
var full = url.substring(theChar + 1,url.length)
if (url.charAt(url.length - 1) == "/") {full = url + "(unknown filetype)"}
if (full=="page1.htm")
{
page1.style.color="red";
page1.style.size="12px";
page1.style.font-weight="bold";
page1.style.background-color="yellow";
}
if (full=="page2.htm")
{
page2.style.color="red";
page2.style.size="12px";
page2.style.font-weight="bold";
page2.style.background-color="yellow";
}
if (full=="page3.htm")
{
page3.style.color="red";
page3.style.size="12px";
page3.style.font-weight="bold";
page3.style.background-color="yellow";
}
if (full=="page4.htm")
{
page4.style.color="red";
page4.style.size="12px";
page4.style.font-weight="bold";
page4.style.background-color="yellow";
}
}
</script>


...........
If I try to add these style propertiesor even one different style property, the link does appear to have the default style.

So my new question is how to add more style and an image in front of the active link?

I am giving the template folder again to show that it is working nicely.

Thanks in advance.

mburt
08-03-2006, 12:04 AM
<html>
<head>
<script>
onload=function() {
var url = document.location.href
var theChar
for (i = 0;i <= url.length;i++) {
if (url.charAt(i) == "/") {theChar = i}
}
var full = url.substring(theChar + 1,url.length)
if (url.charAt(url.length - 1) == "/") {full = url + "(unknown filetype)"}
if (full=="page1.htm") {
page1.style.color="red"
page1.style.background="blue"
page1.style.border="1px solid black"
//you can edit the style through javascript
}
if (full=="page2.htm") {page2.style.color="red"}
if (full=="page3.htm") {page3.style.color="red"}
if (full=="page4.htm") {page4.style.color="red"}
}
</script>
</head>
<body>
<a href="#" id="page1">Page 1</a>
<br><a href="#" id="page2">Page 2</a>
<br><a href="#" id="page3">Page 3</a>
<br><a href="#" id="page4">Page 4</a>
</body>
</html>

mburt
08-03-2006, 12:09 AM
Oh, I forgot to mention, you have to add that code to everypage.

I have an important question to ask:

Are you using frames? Because if you are, that script won't work.

mburt
08-03-2006, 12:36 AM
Girard Ibanez

Need help on a way to highlight the navigation hyper links when page is active.

It's not actually reading the page, but it works:


<a href="#" id="page1" onclick="page2.style.color='';style.color='red'">Index</a>
<br><a href="#" id="page2" onclick="page1.style.color='';style.color='red'">Test</a>

Girard Ibanez
08-03-2006, 01:36 AM
The problem I am having with the js script is that the hrefs are update by the template. So one change on the template changes all the pages.

Would there be a way to do it with making a different style for each page.

mburt
08-03-2006, 02:18 AM
I don't think there's a way to do this with stylesheets.

When I saw your page, It looked like it used frames, so stylesheets wouldn't be the answer.

sharmin
08-03-2006, 03:06 AM
Oh, I forgot to mention, you have to add that code to everypage.

I have an important question to ask:

Are you using frames? Because if you are, that script won't work.


I am not using frame. I am using template design(.dwt extension file). In my template, I have everything, and then I have the htm files(page1.htm, page2.htm etc).

Thank you. It is working: I can change the font color, size, background.

But how I can put an image in front of the active link? Or after an active link ( say like an arrow).

Do you know how to do all these changes by modifying the java files (simpletree.js)? Or is it impossible or requires a lot of change in the java file.


Thank you.