Skip to content
Advertisement

Tag: html

Embedded YouTube videos won’t replay

Strange one: embedded YouTube videos, once played (either by clicking ‘play’ or autoplaying on page load) will not play again. I’m using the standard iFrame embed copied straight from YouTube. This happens with several different short videos and across all browser/OS combinations I’ve tested (Chrome/Safari/Firefox/IE on Windows/Mac). Here’s the code: and you can see it in action at this fiddle.

Hide or remove a div class at mobile viewport?

First and foremost, I am very aware of CSS media queries. My problem is this: When you have div classes stacked in one div; Example: And you want to remove “class2” @media (max-width: 768px) Creating an output of: …once the 768px threshold has been reached. So far I have come up with nothing other than this non-functional code: I am

Onclick event on list item

I’m trying to follow this answer, but rather than using a button as he does in his jsfiddle, I’m trying to use list items: http://jsfiddle.net/hqvDT/108/ It looks like it should work, but when I try to select some text and then press B (for bold), it doesn’t actually bold the text. What’s wrong? HTML: CSS: JS: Answer The problem is

Why scroll to top not working when I use jQuery?

I have a popup that is dynamically loading content and using overflow: auto to maintain the popup size and in turn make it scrollable. I have a link at the bottom currently using anchors to scroll to the top of the div. Unfortunately it is also forcing the page to scroll down to that point as well as scroll to

Display the table when click the button – jQuery/JavaScript

Please advise how to achieve that hide the html inner table when page loading and click the search button, table will display with results only. I don’t want to show the empty table. Please see the below code which I have tried. But sure, after click the button page is getting refresh. JavaScript: When click the button it show the

Size to fit font on a canvas

I currently have this http://jsfiddle.net/dgAEY/ which works perfectly, I just need to figure out a way to size the font when it gets too long. I’ve looked into Auto-size dynamic text to fill fixed size container and I’ve tried to apply the Jquery function they posted but I couldn’t get it to work. HTML JavaScript Answer You can use context.measureText

Add class to parent element

I know this has been asked many times before, but I could not find anything that worked. I will need to add a class to a div that gets autogenerated over my ul. This is my html code: I need to add a second class to div class “wrapper”, but after what I have tried I can’t get it to

Check selected file matches accept attribute on an tag

I wish to prevent the user from uploading a file the server will reject from a page with minimal JavaScript on it, ideally without adding any heavy dependencies like jQuery purely to solve this one problem. Since I’m not targeting legacy users, I trued using the browser’s form validation system to check if the user has selected a valid file,

Advertisement