w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Bootstrap which style controls the hover style for an active parent menu item
It gets the specific styling for that from the CSS Below: .dropdown-submenu:hover>a {} You can change the styling for this by using the same selector and updating the styles. For example: .dropdown-submenu:hover>a { background: red; } Fiddle here: http://jsfiddle.net/n1ck/x2XVt/3/

Categories : CSS

Embedded Code in attribute of asp.net controls
Try putting an event handler on the SelectedIndexChanged event of the GridView; you can then show/hide the panel accordingly: (VB.NET) Protected Sub gvAllQuarries_SelectedIndexChanged(sender As Object, e As EventArgs) Handles gvAllQuarries.SelectedIndexChanged pnlPic.Visible = Not (gvAllQuarries.SelectedIndex = -1) End Sub Mess around with the logic to get it playing how you want, adapt to C# if need be. As an alternative you can wrap the panel in a conditional block if you want it all inline: VB.NET: <% If gvAllQuarries.SelectedIndex <> 1 Then%> <asp:Panel ID="Panel1" runat="server"> //put whatever inside the panel </asp:Panel> <% End If %> C#: <% if (gvAllQuarries.SelectedIndex != 1) { %> <asp:Panel ID="Panel1" r

Categories : Asp Net

Asp.net Dynamic Controls - Name Attribute of HtmlInput object
Michael Liu provided a solution, but he responded to my question, so i cant mark it as an answer. But it is the right thing to do, Use obj.ID = "myID" and this will be retained as your control name.

Categories : C#

adding attribute to dynamic controls generated in javascript
For dynamically generated content you could use on $("form").on("change", function(event) { alert('Checkbox click!'); });

Categories : Javascript

Which attribute controls the actual data submitted in a selectOneMenu?
As the entitiy which you would like to create and for which you are selecting a category is a question you have to set the values on questionController.newQuestion. I.e. you would have to set the categoryId on questionController.newQuestion.categoryID. Which you can achieve by setting the value of p:selectOneMenu to that. So try the following for the p:selectOneMenu-open-tag: <p:selectOneMenu value="#{questionController.newQuestion.categoryID}">

Categories : JSF

How to get text from a
This will get exactly what you want: address = soup.find('div', {'style':'float:left;width:100%;padding-top:10px;padding-bottom:30px;'}) print address.get_text() use a dict to define the style attr use get_text() to get text between tags

Categories : Python

Find div with style attribute jquery
Use an attribute selector: $('div[style]') However, using this to find an element with a specific style (CSS rule) is a bad idea. It will only work for inline styles actually set using style="whatever" and your attribute value in the selector (div[style="whatever"]) would have to match the attribute exactly. So... the proper way to do it is to add a class attribute to the relevant elements and select them using this class (div.whatever for class="whatever" or class="foo whatever bar"). If you still need to find elements with a certain CSS rule the most reliable way would be to iterate over all of them and check if they have the given style: $('div').filter(function() { return $(this).css('whatever') == 'the_value'; });

Categories : Jquery

Can I style the alt attribute of an image tag in jquery?
Try to find out how the function works, that will save you lots of time in the future. I see you've got more questions about the very same function, which all wouldn't have been necessary if you already knew how it worked. (Sorry, in case you didn't realise, that was tongue in cheek. Because the same thing is true for every other question here on StackOverflow!) Anyway, the trick is to make the outer div position:relative so that the inner divs are positioned in the same spot. Then all you need to do is put them in the middle, for instance by setting the line-height to the same value as the height of the image. And with absolute positioning, you won't need the z-index. Resulting fiddle here

Categories : Jquery

JQuery printThis and Style attribute
Instead of touch css attributes directly, add a .myStyle class in your stylesheet with those css properties, and later call .addClass('myStyle') or .removeClass('myStyle') from your function, I think printthis.js imports your local css files. My english is terrible sorry, hope you understand the concept

Categories : Javascript

How do I set an attribute on a many-to-many relationship code first-style?
What you are trying to achieve is called a many to many relationship with attributes. In order to model N to M relationships in a relational database you will always need an intermediate table. To add the attribute with EF, you need another entity to model the relationship and map it properly. In this question it is explained how to do it: Entity Framework Code 1st - Mapping many-to-many with extra info

Categories : C#

Add CSS attribute to certain span that contain a CSS style using JavaScript
Give class or id to those elements. .spanOne{ display: none; } or create those elements dynamically and store them in variables. Then you can use those variables to add or remove properties. var spanOne = //code to create span element; var spanTwo = //code to create another span element; $(spanOne).hide(); or $('#parentElementID').children('span').eq(0).hide(); UPDATED: $('div').children('span').filter(function () { return this.style.fontSize == "17.7px"; //in your case 1.7px }).eq(0).css('backgroundColor', 'red'); PS: I recommend adding a class name or id to that element.

Categories : Javascript

Selecting style attribute with REGEX in PHP
You have it almost correct, you just need to capture the part you want, by surrounding it in parenthesis. You're currently capturing the wrong part: $img = '<img src="test.png" style="float:left;"/>'; preg_match('/<[^>]+ (style=".*?")/i', $img, $match); $result = $match[1]; Demo Note: This will work for simple inputs like the example <img> tag, but for anything more complex Regex is not powerful enough to parse HTML, since HTML is not a regular language. If you find that it's not powerful enough you can use DOMDocument, which is meant for this sort of thing.

Categories : PHP

How to get a style attribute from a CSS class by javascript/jQuery?
How about this? $('<span class="highlight"></span>').appendTo('body'); $(this).animate({ color: $('.highlight').css('color') }, 750); $('.highlight').remove(); It's kind of dirty but will give you an (empty) element to reference to get the CSS value for which you are looking. Update Here is a decent solution from CSS parser/abstracter? How to convert stylesheet into object function findColorProperty(selector) { rules = document.styleSheets[0].cssRules for(i in rules) { //if(rules[i].selectorText==selector) //return rules[i].cssText; // Original if(rules[i].selectorText == selector) return rules[i].style.color; // Get color property specifically } return false; } Usage $(this).animate({ color: findColorPro

Categories : Javascript

Why does jQuery 2.0.2 add empty style attribute to body
While this doesn't actually affect anything it's still a valid question. The reason is this code: // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); This is just a test for boxSizing support. jQuery.swap() is described in the source as: A method for quickly swapping in/out CSS properties to get correct calculations. body.style.zoom != null ? { zoom: 1 } : {} returns zoom: 1 if body.style.zoom is not null and an empty object if it is. The returned value is then applied to the body element which is why it has an empty style tag.

Categories : Jquery

How do you change the style attribute on a TreeGrid PropertyColumn?
You can try to override the PropertyColumn method getCellCssClass(), something like that: PropertyColumn column = new PropertyColumn( columnId,new Model<String>( columnName ), somePropertyExpression, sortProperty ) { @SuppressWarnings("rawtypes") @Override public String getCellCssClass( IModel rowModel, int rowNum ) { if( getId().equals( "testid" ) ) { return "testCell"; } else if( getId().equals( "blablaId" ) ) { return "blablaCell"; } else { return null; } } };

Categories : Java

How to check if HTML style attribute exists with javascript
if(contentWrapper.getAttribute("style")){ if(contentWrapper.getAttribute("style").indexOf("display:") != -1){ alert("Not Empty"); } else { alert("Empty"); } }

Categories : Javascript

Is there a limitation when applying the style via the class attribute in javascript?
You should be using className and not class. lbl.className = 'label'; Modern Day browsers support classList lbl.classList.add("label");

Categories : Javascript

Reason why style attribute does not use the android: namespace prefix
From the documentation: Note: The style attribute does not use the android: namespace prefix. The reason style doesn't use the android namespace prefix is because it is part of the stock XML attributes.

Categories : Android

How to remove the style attribute from li tag nested within two divs via Jquery
Simply you can do $("li").removeAttr("style"); //removes all li style attributes. If li in a div $('.garage li').removeAttr("style"); // remove specifically inside a div.

Categories : Jquery

retrieve html inline style attribute value with jsoup
You can retrieve the style attribute of the element and then split it by :. Example: final String html = "<th style="text-align:right">4389</th>"; Document doc = Jsoup.parse(html, "", Parser.xmlParser()); // Using the default html parser may remove the style attribute Element th = doc.select("th[style]").first(); String style = th.attr("style"); // You can put those two lines into one String styleValue = style.split(":")[1]; // TODO: Insert a check if a value is set // Output the results System.out.println(th); System.out.println(style); System.out.println(styleValue); Output: <th style="text-align:right">4389</th> text-align:right right

Categories : Java

How to resolve root relative URL in a style attribute for background-image
A separate class in an external stylesheet is cleaner (and the path will be relative to the stylesheet). However, you can use Url.Content('~/images/department/" + Model.DepartmentImage ) inside your view to return the complete, resolved path. Note that this isn't an absolute URL (details), but based on your example syntax you are looking for the URL to be resolved to the application root, regardless of where in the directory hierarchy the URL is output.

Categories : Asp Net Mvc

InDesign CS6 Script to Change Style based on XML Attribute not working
you will want to use the correct xPath Expression to match your paragraphs var subheadElementList = rootElement.evaluateXPathExpression("//*[@class = 'boxtitle']"); or more specific if your paragraphs have the markupTag name "mypara" for Example: var subheadElementList = rootElement.evaluateXPathExpression("//mypara[@class = 'boxtitle']");

Categories : Javascript

How do I bind data to a CSS property without using the style attribute of the element in Dart web-ui?
I would suggest thinking about this in a slightly different manner: try applying a CSS class using the Dart syntax <html> <body> <element name='foo' constructor='FooElement' extends='div'> <style> div { display: block; } div.hide { display: none; } </style> <template> <div class="{{isVisible ? '' : 'hide'}}">Foobar</div> </template> <script type="application/dart" src="xfooelement.dart"></script> </element> </body> </html>

Categories : CSS

CSS selector to check an attribute of a child div and style based on the result?
No, you cannot.. yet. The CSS4 Selectors Spec shows a way to choose the subject of a rule, but it is not implemented in any browsers. To note, hopefully you will be able to do this soon (from the spec) For example, the following selector represents a list item LI unique child of an ordered list OL: OL > LI:only-child However the following one represents an ordered list OL having a unique child, that child being a LI: !OL > LI:only-child

Categories : HTML

Setting a left style CSS attribute to move a slider in Javascript
this is because you do not write the style, you just read it and edit the value itself but not the target.left function move(tag) { var target = document.getElementById(tag).style; var current = target.left; function moveObject () { current = parseInt(current) + 10 + 'px'; console.log(current); target.left = current; // <- setTimeout( moveObject,1000); } setTimeout( moveObject, 1000); }

Categories : Javascript

Use of tab-size style (CSS) attribute seems to be being ignored - could be a browser bug, want to check before informing mailing list
Please check the MDN documentation on the tab-size property. It is still an experimental property and as such you need to add vendor prefixes to make it work in some browsers. Chrome accepts plain old tab-size without a vendor prefix, but to add Firefox and Opera support you will need to do the following: tab-size:4; -moz-tab-size:4; -o-tab-size:4;

Categories : HTML

using custom controls instead of user controls to create complex views
Unless you need the functionality provided by custom controls, I would suggest using UserControls or DataTemplates. They are simpler. Here's a related questionanswer. WPF User Controls vs Custom Controls

Categories : Wpf

Opaque panel, over the top of other controls on form, some controls are drawing over it thought?
Try the .BringToFront() method on the panel, or the .SendToBack() on the controls that are over your panel. See MSDN Documentation. Usually, when you add a new control, its added in front of every other control of that parent.

Categories : C#

RaiseEvent between User Controls where there are multiple instances of the same controls on one page ASP.net
The solution I found to this problem is from an old article from 2002 on Code Project. Here's the link to that article ASP.NET User Controls - Notify One Control Of Changes In Other Control. After reading that article and looking through sample code, here are the following changes I made to the code above. There are no changes to the ASPX files except the following line in the Output ASPX file should be removed. <%@ Reference Control="~/Input.ascx" %> First you add a new class called LabelChangeEventArgs. Public Class LabelChangeEventArgs Inherits EventArgs Private _LabelStr As String Public Property LabelText() As String Get Return _LabelStr End Get Set(value As String) _LabelStr = value End Set End Pro

Categories : Asp Net

DNN: Using multiple web user controls in one module and showing different controls in different pages
Astro, Option 1: You need to go to Host > Extensions > Edit your extesion > Expand Module definition and click on add control. Here you have to select your ascx control and provide key as any string. Let's say you provided key test, you selected user control and selected control type as view and saved it. Now from view you can use following code to navigate to the newly added control: DotNetNuke.Common.Globals.NavigateUrl(TabId,"test","mid="+ModuleID); This will redirect the page and load your page with test.ascx. You can use this kind of option when you want to show view.ascx by default and want to switch view when on some action and show test.ascx. Disadvantage here is, when you switch to test.ascx, all other modules added to page will not be visible. Option 2: You have to creat

Categories : C#

Difference between using XML for static controls and making controls programmatically?
There is no performance loss / the performance loss is negligible compared to the HUGE productivity / code cleanliness gained by doing things the RIGHT way. And XAML is not static. There is DataBinding, and if you need to add / remove items dynamically there is the ItemsControl. There is also the concept of DataTemplates that dynamically render specific UI depending on what Model / ViewModel objects are passed to it. Do not manipulate nor create UI elements in procedural code. WPF is not winforms.

Categories : C#

FireMonkey controls based on iOS controls do not behave correctly
For solution we should know: Each Firemonkey form bases on Native UIView, which is subview by root view in Main UIViewController. So when you insert control on a FireMonkey form, that control stay on Form's UIView. All standart Firemonkey Controls doesn't have Native UIView. FMX form have all FMX controls and manages them. Firemonkey WebBrowser bases on UIWebView and is displayed like a subview in a Firemonkey form's UIView. All Popup form are based on UIView with transparent background. Position of popup and size set throught properties TForm.Position, TForm.Size. So you can create a form with transparent background above on Form with TWebBrowser, set size and set position. For the solution of your problem you can: Create new form or popup form Set size and position for it. Show i

Categories : IOS

Perl regex to match alt attribute as mandatory but sometimes alt attribute comes before src attribute and sometimes after src attribute
Does it have to be just one regex only? use Data::Dumper; my $s = q{<img rel="relfoo" src="srcfoo">}; my @m; $s =~ m{ <img s+ ( ((w+)(?{push @m, $^N})) = "( ([^"]*) (?{push @m, $^N}) )" s* )+ > }x; my %h = @m; print Dumper \%h; die "alt is mandatory.. " if !exists $h{alt}; output $VAR1 = { 'rel' => 'relfoo', 'src' => 'srcfoo' }; alt is mandatory..

Categories : Regex

Using jsoup is there a way to get anchor tags that are within div tags with class attribute that have display none style in the css class..?
Select all <a>-tags and search if one of the parents is a <div> with the hiding-class: for (Element a : doc.getElementsByTag("a")) { for (Element parent : a.parents()) { if (parent.tagName().equals("div") && parent.hasClass("hidden")) { a.remove(); } } } Or easier - just remove all anchors in a <div> with the hiding-class: doc.select("div.hidden a").remove();

Categories : CSS

Trying to have both stylize() randomly select cell bgcolor and text style separately using CSS style
If I understood correctly, you are not being able to change the background correct? You need to fix the following CSS styles: .myBackground1{color:blue} .myBackground2{color:red} etc... with .myBackground1{background-color:blue} .myBackground2{background-color:red} etc... and change the code: function stylize() { if (index > 20) index = 1; var s = "myStyle" + index; var e = document.getElementById("MessageText") e.className = s { var bgindex = 0; bgindex++; if (bgindex >5) bgindex =1; var b ="myBackground" + bgindex; var c = document.getElementById("MessageCell") c.className = b } } with function stylize() { index = getRandomInt(1, 20); var s = "myStyle" + index; var e = document.getElementById("MessageText") e

Categories : Javascript

style in wpf when targetted only on textblock, also applies same style to button contents automatically
Basically most of the text you see in WPF Window is eventually converted into TextBlock. If you specify <Button Content="ABC"/> what WPF will actually do is put <TextBlock Text="ABC"/> into Button.Content when its ContentPresenter creates visual tree. So your implicit style does not apply to Button but to TextBlock which is part of its content.In WPF control has its default template which is build from other controls that can be build from other controls until eventually every text ends up as TextBlock that's why Microsoft put protection in place and normally implicit Style is applied in templates only to elements inherited from System.Windows.Controls.Control to protect most basic elements like TextBlock, which is inherited straight from System.Windows.FrameworkElement, from u

Categories : C#

Why doesn't the DOM style node show styles applied by a style sheet?
To elaborate on my comment... element.style "represents the element's style attribute," or the element's own styles as from the style attribute or direct manipulation. To get the styles the element is actually using (including inherited), you can use getComputedStyle() in most browsers (optionally with getPropertyValue()) or element.currentStyle in oldIE: window.getComputedStyle(document.body).backgroundColor window.getComputedStyle(document.body).getPropertyValue('background-color') document.body.currentStyle.backgroundColor Or, since you're using jQuery, you can also use .css(propertyName): $(document.body).css('background-color');

Categories : Javascript

In Rails, how can I include a style sheet from the asset pipeline as a