Skip to content
Advertisement

Force “landscape” orientation mode

I’m trying to force the “landscape” mode for my application because my application is absolutely not designed for the “portrait” mode. How can I do that? Answer It is now possible with the HTML5 webapp manifest. See below. Original answer: You can’t lock a website or a web application in a specific orientation. It goes against the natural behaviour of

Set default filter for Kendo UI Grid

I have a Kendo UI grid that is rendered with javaScript. I want the string columns to have a single option (“Contains”) and without the second filter. So far so good, I wrote As part of the definition of the grid. And the result looks good-ish (I only have one option, so the drop down is redundant). However, regardless of

Remove first child in javascript

I’m trying to remove the first li in an ol using the DOM removeChild(). But for some reason it doesn’t work. This is my javascript: And this is my HTML: I tried alerting the childNodes[0], and it returns [Object Text], which seems a bit weird, when I was expecting just the object. Hope I’ve been clear. Answer Between the <ol

How do I add text to specific div element using jQuery?

I am having a problem with jquery. My HTML is Now I am trying to add text in span using Jquery. After that it becomes, But, I am tryting to achieve is, How can I do that in jquery? Answer Several possible alternatives Others have provided their answers already but let me give you some more alternatives. The second and

Inject Javascript code into a web page

I’d like to download web page as html file. Before I save the web page source code in html file, I’d like to edit some of the page content first. I assume I can edit the content using Javascript. Unfortunately I have little experience with Javascript. I guess I have to inject my script into the web page so that

Bootstrap close responsive menu “on click”

On “PRODUCTS” click I slide up a white div (as seen in attached). When in responsive (mobile and tablet), I would like to automaticly close the responsive navbar and only show the white bar. I tried: also tried: And it does work. However in desktop size, it is also called and does something funky to the menu where it shrinks

Convert SVG Path to Relative Commands

Given an SVG Path element, how can I convert all path commands into relative coordinates? For example, convert this path (which includes every command, absolute and relative, interleaved): into this equivalent path: This question was motivated by this question. Answer Snap.SVG has Snap.path.toRelative(). Fiddle

Advertisement