NetTalk Central

Author Topic: Custom CSS and Javascript includes?  (Read 3344 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Custom CSS and Javascript includes?
« on: January 11, 2014, 01:35:15 AM »
Hey all,

I am trying to incorporate a 3rd party Lightbox functionality into my NT7 project.

The Lightbox developers say I just need to include one CSS and one JS file into my site and it is all good to go.  I went to the 'Action' properties on my IndexPage which is the main page of my site, and under the 'Scripts' and 'CSS Class' tabs, I added in the relevant JS and CSS files.

Now, when I go to my site, under the main home page, I see the two custom included CSS and JS files in the <head> section, but as soon as I open another Browse or Form, they disappear!

How can I make these custom included files persist through ALL pages on my site?

Thanks,
Devan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Custom CSS and Javascript includes?
« Reply #1 on: January 11, 2014, 12:09:49 PM »
Add them to the scripts and styles in the webserver procedure, net talk extension, scripts/files tab and styles/files tab.

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Custom CSS and Javascript includes?
« Reply #2 on: January 11, 2014, 02:57:05 PM »
Ah! Thanks Bruce - this worked perfectly.

The only other thing is the widget initialisation code that goes with this library that has to be in the $(document).ready() section.

I've put it in the PageFooterTag procedure as an embed point, and it seems to work *sometimes*.

It's a jQuery lightbox plugin, and when I open a browse with images on it, the very first click doesn't pop a lightbox up, but subsequent clicks work perfectly.  Either there is another event handler that is interrupting that first click (happens when I open the browse or PgUp/PgDn to a new page and click on an image), or the initialisation code isn't getting called when it first opens?!?




Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Custom CSS and Javascript includes?
« Reply #3 on: January 11, 2014, 09:26:42 PM »
Scrub second question - I figured out an alternate way of doing the popups just within NT (using NetWebForm)