Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

October 31, 2020, 01:39:27 PM

Login with username, password and session length
Members
  • Total Members: 3795
  • Latest: PoML
Stats
  • Total Posts: 191363
  • Total Topics: 20908
  • Online Today: 85
  • Online Ever: 1000
  • (October 07, 2020, 04:15:10 PM)
Users Online
Users: 1
Guests: 72
Total: 73

Author Topic: Javascript in HTML articles  (Read 333 times)

0 Members and 1 Guest are viewing this topic.

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 340
Javascript in HTML articles
« on: September 18, 2020, 12:29:26 PM »
Bear with me, I'm not good with Javascript.

I am making box score articles for hockey games. They'll have an embedded youtube "full game" video and then for the goals, I will hyperlink the players name who scored to have a youtube video of their goal popup and the background darken.

I've found a few scripts and they all have HTML, CSS, and Java Script.

Obviously I'm using the HTML in my article for the goal hyperlinks. I uploaded the javascript and CSS to the site root. But I'm not sure how to put the head code into the article. Do I put it down at the bottom in the head code box with <> head tags or just the code?

Stepping up trying to be a bit more advanced so I'm trying something new. Any help is appreciated.

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Javascript in HTML articles
« Reply #1 on: September 19, 2020, 06:54:20 AM »
Ross, I'm no coder so might not be much help, but have you an example of such a script?

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 340
Re: Javascript in HTML articles
« Reply #2 on: September 19, 2020, 07:18:11 AM »
Hi Mick, @Mick "iDesign Mick" pointed me in the direction of this script https://www.jqueryscript.net/other/Vimeo-Youtube-Video-Popup-Plugin-jQuery.html and it works great! However, I tried using the header code field at the bottom of the article and couldn't get the popup to work. So I just put the HTML in my article with all of the other code and it works.

So my question is this, what is that field at the bottom of the articles for? Thanx, Ross

Online @rjen

  • Support Team
  • *
  • Posts: 2608
    • FJR-club Nederland
Re: Javascript in HTML articles
« Reply #3 on: September 19, 2020, 07:22:50 AM »
Hi Mick, @Mick "iDesign Mick" pointed me in the direction of this script https://www.jqueryscript.net/other/Vimeo-Youtube-Video-Popup-Plugin-jQuery.html and it works great! However, I tried using the header code field at the bottom of the article and couldn't get the popup to work. So I just put the HTML in my article with all of the other code and it works.

So my question is this, what is that field at the bottom of the articles for? Thanx, Ross

The field at the bottom of the article CAN be used to put you own formatting in if you do not want to use the standard format from your theme...

But tbh I never ever used it, and I am wondering if anyone does...
Running TP2.0.0 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 340
Re: Javascript in HTML articles
« Reply #4 on: September 19, 2020, 07:51:52 AM »
Yeh, I was just wondering and no biggy since it works, just took some futzing around and I figured it out. I'm really happy with it!

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Javascript in HTML articles
« Reply #5 on: September 19, 2020, 07:56:57 AM »
Hi Mick, @Mick "iDesign Mick" pointed me in the direction of this script https://www.jqueryscript.net/other/Vimeo-Youtube-Video-Popup-Plugin-jQuery.html and it works great! However, I tried using the header code field at the bottom of the article and couldn't get the popup to work. So I just put the HTML in my article with all of the other code and it works.

So my question is this, what is that field at the bottom of the articles for? Thanx, Ross

The field at the bottom of the article CAN be used to put you own formatting in if you do not want to use the standard format from your theme...

But tbh I never ever used it, and I am wondering if anyone does...

It does have potential, especially if you can write css.  Unfortunately I don't. lol..  http://lts4.byethost7.com/testsite6/index.php?page=4

Tino says it's a powerful feature.

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 340
Re: Javascript in HTML articles
« Reply #6 on: September 19, 2020, 08:46:19 AM »
But I've put CSS in there and it doesn't work. I move it back to the body of the article and the CSS works there.

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Javascript in HTML articles
« Reply #7 on: September 19, 2020, 08:58:59 AM »
css will only work in there if you tick the box just above it "Do not use SMF templates"

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 340
Re: Javascript in HTML articles
« Reply #8 on: September 19, 2020, 09:03:56 AM »
Okay, well it works in the article too but of course I'm using the default template anyway.