Results 1 to 10 of 10

Thread: Dropdown Text

  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Dropdown Text

    Novice here!

    I use RoboHelp to create online help. One of the tools with RoboHelp is a DHTML effect where by highlighting a graphic or some text, when the user clicks on the hotspot, whatever text I have defined is displayed as an additional section between the end of the paragraph containing the hotspot and what had been the next paragraph.Thus if this paragraph contained the hotspot, then the text displayed would appear as the next paragraph. The text displayed can include graphics, tables, anything you can put in an HTML page.

    The problem with what RoboHelp have supplied is that it only works Internet Explorer. I want to be able to produce something that will work in IE or Firefox. My thinking was that some javascript using document.write would be the thing to use but I soon realised that creates a new page with the text defined. It would also seem that you cannot use it to write tables.

    Can someone please advise whether what I want to do is achievable by someone with very limited skills, or even possible at all?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dropdown Text

    Starting with IE version 5, the code for hiding and displaying a DIV or SPAN is (or at least can be) identical between IE and Mozilla/Firefox. The problem is that IE4 used a nonstandard document object model, and probably RoboHelp is using the IE4 model for maximum compatibility with the installed base.

    For example of how to show or hide a paragraph using W3C-compliant code, see <post#=245854>post 245854</post#>. This corresponds to a page on our intranet that I can only provide a peek at.
    Attached Images Attached Images

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dropdown Text

    Peter, I probably was too vague. Can you mock up a sample page in RoboHelp that shows the content and the script (or if the script is in a separate .js file, zip it up with a copy of the page) and post it here? Then I can show you how to make it cross-platform. Obviously if every page needs to be edited, that's a big headache, but if you can centrally override one script file, that's not too bad.

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Dropdown Text

    Hi Jefferson

    Thanks for the reply.

    Better than a mock up, see the real thing at www.grainge.org. If you view in IE, most pages have a Revisions button at the top and this will reveal a table showing the changes. View the same page in Firefox etc and the table will be displayed when you open the page.

    View source will of course give you access to the HTML but there is an issue with the js file. It is proprietary to Macromedia so I don't think I should post it here for all to access. That said, if you would like to send me an email using the feedback page on my site, then I would be happy to send it to you offline. However, it contains lots of javascript unrelated to this issue so it might be a bit of a read!

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dropdown Text

    When I open your home page, the Firefox JavaScript console has over 200 of these error messages, at they multiply at regular intervals:

    Error: setting a property that has only a getter
    Source File: http://www.grainge.org/whmozemu.js
    Line: 52

    So the first problem seems to be something severely wrong with some bit of the JavaScript in the Mozilla/Netscape branch of the site.

    Parsing the script is a bit complicated. Let's start with browser detection. This is the result of the script whver.js:

    var gbNav6=true;
    var gbNav61=false;
    var gbNav4=true;
    var gbIE4=false;
    var gbIE=false;
    var gbIE5=false;
    var gbIE55=false;

    Reading, testing... the error is generated by this line window.document.body.scrollHeight = document.height (Note: it doesn't help to add a semicolon at the end).

    The really strange thing is not that IE has a property that Mozilla doesn't support, but that even Microsoft says this property is read-only, so why is the JavaScript set up this way?!

    What I suggest to enable the next round of testing is to comment out this code at the end of the whmozemu.js file by inserting // in front of each line:

    // Create compatibility layer for Netscape
    if (window.gbNav6) {
    setInterval("testScroll()",50)
    }

    If we remove that, perhaps Firefox will be able to move forward.

  6. #6
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Dropdown Text

    Hi Jefferson

    I am confident enough to try that on a copy of my site but the rest of it looks like getting into territory that concerns me in two ways. Firstly my ability but mostly what you are doing, if I've understood correctly, is trying to fix the problem with the existing javascript. I need to avoid that in case it has other unforeseen consequences on how RoboHelp works and, from experience with that application, the javascript will likely change between versions and render the solution useless.

    What I was really seeking to find was a fairly straightforward way of doing this with DHTML / Javascript that is quite independant of my HTML editor. I looked at several sites with sample javascripts that make text whiz in from any part of the world, spin it six times and stir your coffee, but none with something real useful like this.

    I'll try what you have suggested and report back although it may be the weekend before I get to it.

    Very many thanks for your response.

  7. #7
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Dropdown Text

    Hi again Jefferson

    I'm also curious and interested in how you got the Javascript console to reveal all that information. I'm new to Firefox and not sure how to point the console at my site to reveal that? Entering the web address did not work.

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dropdown Text

    The JavaScript console lists errors and warnings about the currently displayed site (and everything else from the current session, I think). You will see "warnings" for message compose pages in the Lounge, where Firefox chides you for using "deprecated" methods, and red stop signs for fatal errors.

    To access the console, use Tools>JavaScript console. Click Clear to get rid of the clutter, then load the page you want to test. Does it work? (It might be an extension, but it was included in the original install, so you should have it.)

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dropdown Text

    <P ID="edit" class=small>(Edited by jscher2000 on 16-Nov-04 12:51. Here's my test page (revised).)</P>I hate to say it, but the tool looks to be pretty lame. I downloaded your content frame (home.htm) so I could work around the nasty bug caused by loading the main index page. Here is the containing element for the part that is supposed to be hidden:

    <div class="droptext" id="POPUP241421038" style="display: 'none'; " x-ss-type="dropdown">

    It works in IE, but not in Firefox. Why not?

    Because 'none' is not a valid value for the display property. To hide the DIV it should be none (no single quotation marks). Okay, fixing that hides the DIV, but the script still doesn't work. The code for the button and the surrounding link is:

    [img]../btnrevisons.gif[/img]

    The function kadovTextPopup is passed an object (the current element). The first thing the function does is perform the following test :

    if( (!CCSSP.bIsWinOS && !CCSSP.bIsSunOS && !(CCSSP.bIsMacOS&&CCSSP.bIsIE5)) || (window.event == null) )

    In Firefox, this evaluates to (False AND True AND True) OR True, which causes the function to exit, doing nothing. In other words, Mozilla-based browsers are not supported. (Maybe this is why the code uses 'none' in the DIV tag? So that the dysfunctional button is not needed to see the change list in Mozilla-based browsers? Probably I'm giving too much credit where it isn't due...)

    There are many simple and effective ways to approach this problem, but the tool's code is a desperate tangle that you probably just have to accept (making your site less functional in Mozilla-based browsers) or throw in the garbage (meaning, lots of re-work for you). Sorry!
    Attached Files Attached Files

  10. #10
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Dropdown Text

    First thanks for additional info on my site. Looks like another approach is called for at some stage. At least Firefox users can see the revisions.

    As to the console, yes it is installed. I think I was expecting to have to point the tool at the site rather than open the tool and then go to the site. Interestingly, if I do that, it does not report any errors.

    I'll point it at home.htm later and see what happens, that incidentally is just the page you see in the main frame. That is called by another page so yes it is all rather a tangle.

Posting Permissions

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