- Create Account

Reading displayed area

Forums > Inline HV Scrollbox > Reading displayed area
Author
Message

1) Garison Piatt Group: Guests
IP: 24.25.--.--
I'm using your hvscroller for a number of things, including a news tickertape and a "rollover" page, where you can cycle through different content using mouseovers.

Now, I want to be able to print whatever is currently displayed. The name of the active page is in pageName, but I'm not quite sure how to extract the HTML code from there. I'm still looking, but I would like to know if you have an easy way of doing this.

-garison

2) Angus Turnbull Group: Guests
IP: 210.54.--.--
I'd just use scrollerName.div.ref.innerHTML which won't work in NS4. You could always construct your scroller pages using a CGI script and use the same data to produce a "print-friendly" page? Or try the other scroller script, since it uses external files this is an easy question with that :).

-  Angus.

3) Garison Piatt Group: Guests
IP: 24.25.--.--
Okay, it's "sort of" working. I have this:

function ilsPrint() { with (this) {
if (!pageName || !isDyn)  return;
if (isNS4) return;

 var prWin = open('','',
          'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,'+
          'resizable=0,width='+scrW+',height='+scrH+',dependent=1'  );
 prWin.document.write(
  '<html>'+
   '<script  language="JavaScript1.2">'+
  'function printThis() {'+
  '  self.print();'+
  ' setTimeout("self.close()",5000);'+
  '}'+
  '</script>'+
  '<body  onload="printThis()">'+
  div.ref.innerHTML+
  '</body>'+
  '</html>');
prWin.document.close();
}}

As   you can see, I'm not that concerned if it doesn't work on NS4. To print, I have a form:
   <form action="#">
    <input type="submit" value="print" onClick="scr.print(); return false;"
          style="font-size: 11px; color: Black; background-color: #CCCCFF;" >
   </form>

Everything works fine, except that after it prints, I get a JavaScript error, "isNS4 is not defined" at line 64, which is in the middle of the ilsScrollTo function. Not quite sure what's going on. Any ideas?

-garison

4) Angus Turnbull Group: Guests
IP: 210.55.--.--
Not really -- you've hacked up the code a lot from the standard script, so I can't really second-guess or debug your own modifications. Make sure you're not referencing isNS4 from within the popup window?

- Angus.

5) Garison Piatt Group: Guests
IP: 24.25.--.--
Actually, that *was* the problem. This--
      <script  language="JavaScript1.2"><!--
       if (!isNS4)  document.write('</div></div>');
      //--></script>
was  at the end of the captured data. All I have to do now is search for "<script" and take everything to the left of it.

And I wouldn't quite say "hacked up" -- I've left your original code intact, and added my stuff separately. My thinking is, at some point you will have an update to this software, and I want to use that upgrade as painlessly as possible.

-garison

6) Garison Piatt Group: Guests
IP: 24.25.--.--
Yup, works like a champ. Check out:
 http://www.robinajessbotanicalart.com/rollover.php?keyword=bio
It's  used on several pages in this site. Actually, it's only used on one page here, but we use keywords to change what's displayed. Note the scroll bar on the right; pretty easy to do.

We also use this on http://rtut.com. We had to switch over because the code I wrote wouldn't work on a Mac. (No such a big deal, IMHO, but others think it is.)

And yes, that's your menu on both sites.

BTW: did you ever get a donation from my client, Carol Dickert? Let me know if not, and I'll remind her again.

-garison

7) Angus Turnbull Group: Guests
IP: 210.54.--.--
Glad you're on track! Yes, external plugin-type code is a good idea :).

A  quick search of my Inbox reveals nothing for "Dickert", so if you want to check with her that would be fine.

- Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.