Page 1 of 2 12 LastLast
Results 1 to 10 of 13

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

  1. #1
    Join Date
    Jul 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

  2. #2
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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 but a lot of the guyz here have busy schedules they can't answer everything all at once. have patience.
    Please don't mind me. I am just posting a lot of nonsense.

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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".

    Code:
    <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>
    - Mike

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

  5. #5
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Gee ... I have a similar post on the css section and dynamic link section.

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

  6. #6
    Join Date
    Jul 2006
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  7. #7
    Join Date
    Jul 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you

    Quote Originally Posted by mburt

    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.

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    <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>
    - Mike

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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.
    - Mike

  10. #10
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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:

    Code:
    <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>
    - Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •