TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:37:18 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 174
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 171
  • Total: 171

Javascript in HTML articles

Started by jernatety, September 18, 2020, 07:29:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jernatety

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.

lurkalot

Ross, I'm no coder so might not be much help, but have you an example of such a script?

jernatety

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

@rjen

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...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

jernatety

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!

lurkalot

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.

jernatety

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.

lurkalot

css will only work in there if you tick the box just above it "Do not use SMF templates"

jernatety

Okay, well it works in the article too but of course I'm using the default template anyway.