w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
WebStorm Linking to a .js file in HTML
No idea what 'Webstorm' is, but your HTML contains no reference to the jQuery library. This is where $ is defined. At the following above your existing <script> tag: <script type="text/javascript" src="[ PATH TO JQUERY ]"></script>

Categories : Javascript

Custom jQuery slider for html elements not working
var currentMargin = $slider.css('margin-top').split('px')[0]; $slider.css('margin-top', '0px'); Update $(document).ready(function() { setInterval(slider, 3000); }); var $slider = $('#slider-viewport .slider'); var marginNew = $('.slider p').height(); var limit=marginNew*$('.slider p').length; function slider() { if(marginNew>=limit) marginNew=0; $slider.animate({"margin-top":-marginNew}); marginNew+=100; }; http://jsfiddle.net/Xh9SM/2/

Categories : Javascript

How to set up vim's identation for literate Haskell programming?
This should be easy to achieve with :set formatoptions+=ro or :se fo+=ro for short. With r and o in 'formatoptions', Vim attempts to insert the comment "leader" including indentation on new lines inside a comment (that is, a non-comment in literate Haskell). To make this setting automatically, set up an autocommand in your vimrc. autocmd FileType lhaskell setlocal formatoptions+=ro Tip: Use CTRL-U to remove the auto-inserted leader when you don't need it.

Categories : Haskell

Webstorm - Link html class reference to scss file
As @Iena said, it's not possible. Try voting for the issue (http://youtrack.jetbrains.com/issue/WEB-6737) and JetBrains may add the feature.

Categories : Intellij Idea

Javascript library to gracefully downgrade custom elements in HTML at runtime
For the first part, maybe something like <mytag>yo</mytag> <script> var map = { MYTAG: function(s){ // surround content with stars return '**'+s+'**'; } } Array.prototype.slice.call(document.getElementsByTagName('*')).forEach(function(tag){ // note on some IE versions you cant set innerHTML directly if(map[tag.tagName]) tag.innerHTML = map[tag.tagName](tag.innerHTML); }) </script> For changing element tags at runtime, I can't recall if that's possible. People may cringe, but I'd maybe take the entire document.body.innerHTML replace it using regexes and reset it. If I knew I was the only creator of the HTML content that may take care of it..

Categories : Javascript

Drupal 7 - Rendering Exposed Form Elements as Icons via Custom Module, outputting string instead of html
I decided to pull this off using jQuery, as achieving the desired affect using a custom module was not pragmatic and may have, in fact, been overkill. Following is the poorly refactored but working code which got me there: (function($) { $(document).ready(function(){ var link = '<a href="http://project.local/blog-posts?field_blog_post_type_tid=', id = '#edit-field-blog-post-type-tid-'; $(id + 'all').html(link + 'All"><span class="icon-container"><i class="icon-undo"></i></span></a>'); $(id + '3').html(link + '3"><span class="icon-container"><i class="icon-music"></i></span></a>'); $(id + '2').html(link + '2"><span class="icon-container"><i class="icon-camera"></i></sp

Categories : Drupal

How to make html elements fire effects on other elements using css
You can try this: .view-first { opacity: 0; /*more properties here*/} .myDiv:hover ~ .view-first{ -webkit-animation: boxanimation 1.5s; opacity: 1; -webkit-transition: all 0s; -webkit-animation-fill-mode: initial; /*more properties here*/} This will work for chrom and safary, for more broser you can set the -moz for firefox, and -o for opera

Categories : HTML

HTML Elements whose parent elements are transparent won't go opaque
Children can't have a higher opacity than their parents as their opacities multiply. You use could png backgrounds or rgba colors: http://css-tricks.com/rgba-browser-support/ div { background-color: rgba(255,255,255,0.5); }

Categories : HTML

HTML overlapping elements in absolute elements
Your problem is how the z-index stacking works. In this case, you actually need to put a z-index on #content that is higher than the z-index of #menu, as those two elements exist in the same stacking context. Two elements are only in the same stacking context if they are direct siblings. In this case, #content and #menu are siblings. You can z-index #content>.layoutOuter all you want but if the z-index of #menu is higher than the z-index of #content, #menu will display higher than it no matter the values.

Categories : HTML

how to convert string containing HTML element into HTML DOM elements form in Django Python
you need to set the autoescape to off {% autoescape off %}{{ str }}{% endautoescape %}

Categories : Jquery

Convert html encoded string back into html elements jQuery/JavaScript
Here's a quick example. You just pass it into the other jQuery object's html function. JSFiddle HTML: <div id="someInfo">Hello, this is a simple example.<p>Boom, a paragraph.</p></div> <div id="storeHereLater"></div> CSS: $(function(){ var someInfoHTML = $('#someInfo').html(); $('#storeHereLater').html(someInfoHTML); });

Categories : Javascript

Parse content inside all HTML elements with class .mod in HTML document with PHP
You could use xpath $path = new DOMXPath($this->document); $nodes = $path->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' mod ')]");

Categories : PHP

jQuery - how to append values into html elements without getting them parsed as html tags
You can use html() to set the element markup, then find() the container you want to insert text into and invoke text() on it. In your case, something like: $("#htmltest").html("<ul><li></li></ul>").find("li").text(testvar);

Categories : Javascript

How can I use these Node modules to accept HTML through a file or URL and then output JSON as validation of existing HTML elements?
Depending on the arguments call either one of checkHtmlFile() or checkUrl() Something like: if (program.url) checkUrl(program.url, program.checks); else checkHtmlFile(program.file, program.checks); Read this for more references: commander.js option parsing Also, checkJson2 is undefined as checkUrl() isn't returning anything.

Categories : Javascript

How to get first-level elements from HTML file with HTML Agility Pack & c#
Use HtmlAgilityPack to load the webpage from the given URL, then parse it by selecting the correct corresponding tags. HtmlWeb page = new HtmlWeb(); HtmlDocument doc = new HtmlDocument(); docc = page.Load("http://www.google.com"); If you want to select a specific div with the class name 'header', you do so by using the DocumentNode property of your document object. string mainText = doc.DocumentNode.SelectSingleNode("//div[@class="main"]").InnerText; Chances are though that you have several tags in your HTML that are members of the 'main' class, thus you have to select them all then iterate over the collection, or be more precise when you select your single node. To get a collection representation of all tags i.e. in class 'main', you use the DocumentNode.SelectNodes property instea

Categories : C#

Is it possible to create elements from html returned by .html()?
jQuery's parsing heuristics do not like the leading whitespace in html. Removing the whitespace fixes the problem: var html = $.trim( $( "ul.foo" ).html() ); Updated fiddle. Update: Felix Kling dug up the documentation reference way before I was able to.

Categories : Jquery

Custom Textview with Html text and Custom Font whole Android application
Have you consideret to use SpannbleString? How can i use TypefaceSpan or StyleSpan with custom Typeface? Here is different spans that you can apply on SpannableString. public void setSpan(){ Spannable spantext = new SpannableString("My application"); spantext.setSpan(new StyleSpan(Typeface.BOLD), 3//Start of span, 6//End of span, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); Typeface HelveticaNeueBoldItalic = Typeface.createFromAsset(getActivity().getAssets(), "fonts/HelveticaNeueBoldItalic.ttf"); spantext.setSpan(new CustomTypefaceSpan("", HelveticaNeueBoldItalic ), 0, text.lenght(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); TextView text; text.setText(spantext); } public class CustomTypefaceSpan extends TypefaceSpan { private final Typeface newType;

Categories : Android

Custom UI elements
Many things (e.g. hover button) you can implement using style-sheets. In this example the background image is replaced on mouse over: QPushButton { image: url(:/res/button.png); } QPushButton:hover { image: url(:/res/button_h.png); } Take a look at Qt State machines and animation framework. If nothing helps, subclass a widget and re-implement event handlers (most probably paint-event)

Categories : Qt

WebStorm - Node.JS project
it's not currently supported - please vote for WEB-1173 and WEB-8333

Categories : Debugging

How to run build.dart in WebStorm?
OK, thanks to LazyOne's hint I was able to dig a bit deeper. The solution to this is to create a File Watcher in WebStorm with the following options: Scope: Project Files Program: [your path to]dart-sdkindart.exe Arguments: build.dart Working Directory: $ProjectFileDir$ This will run the build.dart every time a file in your project changes, pretty much exactly like the Dart Editor.

Categories : Dart

Setup Jade With webstorm on MAC
The EISDIR error is caused when a Node application expects a file, but gets a directory. This particular instance of that error was thrown by this block of code: fs.writeFile(path, output, function(err){ if (err) throw err; console.log(' 33[90mrendered 33[36m%s33[0m', path); }); You can tell because it's not error number 156, but the line number of the relevant code. Do you, by any chance have a directory named main.html in /Applications/MAMP/htdocs/HTMLCodes/Sports/public_html? Also, you should be able to just execute the command, jade main.jade without the second argument. That would seem to make your life easier. Though if your dead set on using Webstorm on a Mac, this configuration should work equally well, or to keep it really simple, just put $File

Categories : Osx

cannot open file '%f' webstorm
This is something I have no idea why it was showing that message. But upon research,, I found in the menu properties there is the extra "%f" at the end. Remove that, voila. It works with no annoying error.

Categories : Misc

Grunt debugging from Webstorm
You have to run grunt-cli as a Node application: Create a new Node.js Run/Debug configuration: Run->Edit configurations... In Path to Node choose your node binary, ie: /Users/someuser/nvm/v0.10.5/bin/node In Working Directory, choose your Gruntfile.js directory, ie /Projects/someproject In Path to Node App JS File, choose your Grunt CLI path (you can choose the grunt-cli symlink created on your node bin directory, WebStorm will use the symlink target), ie: /Users/someuser/nvm/v0.10.5/lib/node_modules/grunt-cli/bin/grunt (C:UserssomeuserAppDataRoaming pm ode_modulesgrunt-cliingrunt on Windows 7) In Application parameters enter the Grunt task to run, ie test Click on Run or Debug and you are done :)

Categories : Node Js

Multi-select Jetbrains Webstorm
Well, you cannot. I think you're talking about the multiple cursors that are present in Sublime Text 2. But, if your text is aligned, then you can change it using the ALT + CLICK and dragging that. You can vote for this feature as lena mentions. UPDATE This feature is now supported in Webstorm 8. If you press the ALT key and click on a different location, you will get a separate cursor there. Before, you could only drag and create cursors in the same line, however, now you can place your cursor wherever you want to. Please take a look at this video to learn more.

Categories : Misc

webstorm: typescript bool vs. boolean
Webstorm language service currently only works with 0.8.x, The typescript language service inside WebStrom does not understand the changes made in 0.9.x, and since the TypeScript language service api changed (for the better imho) from 0.8 to 0.9 its not a drop in replacement. A new version of WebStorm with these features is on the way though (should be soon).

Categories : Javascript

WebStorm and PHPStorm debug php and js at same time
Solution: As LazyOne suggested I should use "zero configuration" option inside PhpStorm, complete instructions at jetbrains/... Below is a description of the steps: Install Xdebug (sudo apt-get install php5-xdebug) Add inside /etc/php5/apache2/php.ini the lines: [Xdebug] zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9000 restart apache: "service apache2 restart" check Xdebug is enabled "php --version" should show "with xDebug vx.x" Toggle the “Listen debugger connections” button., this will listen for incoming connections to the test.php script Set a breakpoint in the test.php source code Activate the xdebug debugger, to do this we need to set a special GET/POST or COOKIE paramete

Categories : PHP

Getting angularJS autcomplete in Webstorm/PHPStorm
If you don't already have angular set up, go to Preferences > Project Settings > Javascript > Libraries and add your version of angular. As for autocomplete in html strings, I don't think that's going to happen with the current version of PHPStorm, but in most other places, it should do the trick.

Categories : Angularjs

How to set up instant code completion in WebStorm 7 EAP?
It can just be slow. If explicit Ctrl+Space is as slow, I'd suggest you to file a performance problem request to http://youtrack.jetbrains.com/ with a CPU snapshot attached (http://devnet.jetbrains.com/docs/DOC-1253).

Categories : Intellij Idea

How to get HTML elements from a file using PHP
You are showing the page, but are probably lacking content on the page that uses relative paths, such as CSS and images. If you wish to only use part of the page, I suggest looking into DOMDocument. http://www.php.net/manual/en/domdocument.loadhtml.php

Categories : PHP

Overlapping elements - HTML, CSS
Maybe try adding some z-indexes to your #navlevel2 and whatever you call the overlapping element? for example: say #navlevel1 is the dropdown element #navlevel2 { background: url("../images/bg.gif") repeat-x scroll left -59px transparent; clear: both; height: 30px; position: relative; width: 100%; z-index: 1; } #navlevel1 { z-index: 200; }

Categories : CSS

How to display html elements beside each other
How to display HTML <FORM> as inline element? A <p> element is only allowed to contain inline elements. <form> isn't inline, it's a block element. Try wrapping the forms in <div>s for example: <div class="form-container"> @using (Html.BeginForm()) { @Html.ValidationSummary(true) @Html.HiddenFor(model => model.GroupID) @Html.Partial("_CreateOrEdit", Model) <input type="submit" value="Save" class="btn btn-primary"/> } </div> <div class="form-container"> @using (Html.BeginForm("Index", "SecurityGroup", FormMethod.Get)) { <input type='submit' value='Cancel' class='btn' /> } </div> Then use the following stylesheet (either as inline style or in a CSS) .form-container{ display:in

Categories : HTML

How do I set spacing between 2 elements in HTML?
Add margin for img. margin-right:20px; So code would be <img style="background-color:#ffffff;width:250px;height:auto;float:left;margin-right:20px;"

Categories : HTML

Positioning of HTML elements with css
This can be achieved with absolute positioning: header { position: relative; min-height: 100px; } div.meta { position: absolute; width: 100px; height:100px; top:0; left:0; border: 1px solid red; } header h1 { margin-left: 120px; border-bottom: 2px solid red; } header div.textblock { margin-left: 120px; } See fiddle: http://jsfiddle.net/utsKx/ You can change the div.meta widths and h1/textblock margin-left to percentages if you want a responsive layout. EDIT Added min-height to header to ensure div.meta never falls outside the parent header block. (Thanks for MarcAudet for pointing this out)

Categories : HTML

Referencing HTML elements
You can use a class for all referenced elements like: <div id="trigger" data-reference="reference_1">Trigger</div> <div id="meter" class="reference_1"></div> <div id="voltmeter" class="reference_1"></div> And in your jQuery part: $("#trigger").click( function() { var e = $(this); e.addClass("animated"); $('.' + e.data('reference')).addClass("animated"); });

Categories : Javascript

How to select all elements with tag name 'div' but from another html?
If you only have the URL of the other page, you can get the HTML of the page as a string using XMLHttpRequest. Save that string into a variable html. Then you can do: var externalPage = document.createElement("div"); externalPage.innerHTML = html; var divs = externalPage.getElementsByTagName("div"); Now divs is the NodeList of div elements of the other page. If you already opened the other page using window.open(), you can instead use the return value of that call to access its document object: var otherWindow = window.open("http://example.com/"); var divs = otherWindow.document.getElementsByTagName("div"); Note that in both cases you are subject to the same-origin policy.

Categories : Javascript

PHP - getting inner HTML code of two elements
Remove ->textContent $h1 = $doc->saveHtml($doc->getElementsByTagName('h1')->item(0)); echo "NAME: ".$h1."<br>"; $p = $doc->saveHtml($doc->getElementsByTagName('p')->item(0));

Categories : PHP

Rearrange Html elements
Pretty sure this will do the trick: $(".present").each(function(){ if ($(this).is(":empty")){ $(this).append($(this).parent()); } }); The append function removes the element and appends it to the target. By appending it to the container it's already in, it should be removed from the dom and reinserted at the end which should allow the lower objects to naturally move up. If you wanted to animate the effect, you could clone the object rather than append, then target the first instance of it, animate the height value to 0 and then remove it. So, in order to maintain the proper IDs on the containers, you could replace the markup of each with the markup of the next object, but there's quite a bit of content juggling involved there. I would suggest something like this instead (you

Categories : Javascript

HTML 5 Elements, non-JS fallbacks
There is no evidence of SEO effects of markup like article, header, footer, etc. There is a lot of speculation about them. Using redundant markup like you describe would be harmless, but it would not produce any tangible gain as compared with simple div elements (which in turn are needed only for styling or scripting, if at all). The order of nesting does not matter, but since the new elements would be basically for documentation purposes, it would be more natural to use them as outer elements and div as inner.

Categories : HTML

Are all HTML elements unique?
I'm pretty sure the answer is no; each element is unique, regardless of whether they have similar values (including "id"). This might provide you some insight into how element garbage collection works in Chrome. I'm not sure how the other browsers respond though. http://www.html5rocks.com/en/tutorials/memory/effectivemanagement/ It outlines some tools that might be useful to test your theory.

Categories : HTML

Reuse elements of HTML
If you're using straight HTML, you could do it with a SSI include command or by creating a template page and including it in jQuery. Both of these links might help you Include another HTML file in a HTML file and http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341/SSI-The-Include-Command.htm

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.