TinyPortal

Development => Support => Topic started by: jernatety on September 18, 2020, 07:29:26 PM

Title: Javascript in HTML articles
Post by: jernatety on September 18, 2020, 07: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.
Title: Re: Javascript in HTML articles
Post by: lurkalot on September 19, 2020, 01:54:20 PM
Ross, I'm no coder so might not be much help, but have you an example of such a script?
Title: Re: Javascript in HTML articles
Post by: jernatety on September 19, 2020, 02:18:11 PM
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
Title: Re: Javascript in HTML articles
Post by: @rjen on September 19, 2020, 02:22:50 PM
Quote from: jernatety on September 19, 2020, 02:18:11 PM
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...
Title: Re: Javascript in HTML articles
Post by: jernatety on September 19, 2020, 02:51:52 PM
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!
Title: Re: Javascript in HTML articles
Post by: lurkalot on September 19, 2020, 02:56:57 PM
Quote from: @rjen on September 19, 2020, 02:22:50 PM
Quote from: jernatety on September 19, 2020, 02:18:11 PM
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.
Title: Re: Javascript in HTML articles
Post by: jernatety on September 19, 2020, 03:46:19 PM
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.
Title: Re: Javascript in HTML articles
Post by: lurkalot on September 19, 2020, 03:58:59 PM
css will only work in there if you tick the box just above it "Do not use SMF templates"
Title: Re: Javascript in HTML articles
Post by: jernatety on September 19, 2020, 04:03:56 PM
Okay, well it works in the article too but of course I'm using the default template anyway.