I've finished the design and about to code HTML for a website that will use fancy form elements and effects.
I'm wondering if I should support IE6? What are the latest stats? Do you support IE6 still?
Can html 5 elements be created and reused? For example, we can build silverlight controls and reuse them, such as a video player. Can that be done with html 5?
I am currently using find() and first() method to select the first descendent element from each of the <div> elements that contains the parent class. But I find this quite cumbersome since find() method would produce a set of matched elements before the first element is being picked. The following is the skeleton of my code:
HTML
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=non-parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
<div class=parent>
<ul>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
<li>random characters</li>
</ul>
</div>
// .....the list continues
Javascript
$('.parent').each(function() {
$(this).find('ul li').first().css('color', 'red');
// do other stuff within each loop
});
I have seen people using $(".parent li:first") selector. But, because I am doing it in a loop, I am not sure how or whether if this could be done and would like some advice. Thanks.
Hi,
I have string like this;
"String {tag_0} text {tag_2} and {tag_1}"
Now i need to replace all {tag_INDEX} with elements from array
$myArray = array('a','b','c');
so after replacement it should looks like:
"String a text c and b"
What is the best way to do this? I'm trying with preg_replace and preg_replace_callback but without any good results
Hey guys..
Lets say I have an array like
int arr[10][10];
Now i want to initialize all elements of this array to 0. How can I do this without loops or specifying each element?
Please note that this question if for C
For floated elements should we always define display:inline along with overflow:hidden, when we clear float using overflow:hidden?
#secondary-col {
float:left;
overflow:hidden;
display:inline;
}
Hi, I am new to asp.net mvc platform. I'm developing with razor template engine in mvc 3. I've created a layout page for all view pages but in some cases I need different page headers for different view pages. For example I have to insert additional script elements to page header to validate data in form pages.
I want to know is there any way to add html element to layout page's header from view page?
Thanks in advance.
I have elements being generated by dynamic html, I would like to reference the particular href that is calling the function when one of many may be calling it.
<a href="javascript:Foo(this)">Link</a>
Does not work when I try to reference $(this). Is there another way to do this or do I have to make dynamic ids?
I have a QML Flickable with 3 QML image elements that cycle through 8 image files. My problem is for each new image it loads into memory it does not release the the unused image. This is causing memory usage to become double what is necessary at times.
I would like to know if there is some function I can use to force it to unload all the unused images? If it makes a difference, this is mainly for Symbian.
I am going create a new xib which is very similar to an existing one. Instead on of crate an blank new one, copy UI elements and viewcontroller IOOutlets; is there a quick way to clone a xib with corresponding new viewcontroller class?
Thanks
Trying to learn about how to effectively use print.css, so that graphical and navigational elements are not shown in print preview/print. Read some articles, and part of print css of html5 boilerplate. Two sites, which was quite impressive the way they change the look during print are
http://css-tricks.com/
http://bottlerocketcreative.com/
But I cannot see the css related to print. Can you please point to the css they use to learn how to do similar transformation.
thanks.
Is there a case insensitive version of the :contains jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?
I need to loop through some elements in the page and then, for each one, if it had a class beginning with, for example, "C", do something.
$('#dialog li').each(function(){
if ($(this).hasClass("^C")){
//do something
}
}
It may sound silly, but what selector/method should I use on the if clause?
Thanks in advance.
My application starts up another application. whereby, i want to remove the title bar of the application which is started using c#.
How can i do this, starting up with the piece of code below ?
//Get current style
lCurStyle = GetWindowLong(hwnd, GWL_STYLE)
//remove titlebar elements
lCurStyle = lCurStyle And Not WS_CAPTION
lCurStyle = lCurStyle And Not WS_SYSMENU
lCurStyle = lCurStyle And Not WS_THICKFRAME
lCurStyle = lCurStyle And Not WS_MINIMIZE
lCurStyle = lCurStyle And Not WS_MAXIMIZEBOX
//apply new style
SetWindowLong hwnd, GWL_STYLE, lCurStyle
//reapply a 3d border
lCurStyle = GetWindowLong(hwnd, GWL_EXSTYLE)
SetWindowLong hwnd, GWL_EXSTYLE, lCurStyle Or WS_EX_DLGMODALFRAME
//redraw
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_FRAMECHANGED
Hey stackoverflow :)
I wanna use webbrowser control in c++(im using dev cpp).
Ages ago when i was using VB6 i just added webbrowser control (C:\Windows\System32\shdocvw.dll) to my form and it worked but im lost in C++...
should i load it dynamically with LoadLibrary and then somehow put it on my dialog window or how? I also wanna use all features like navigate to page, edit html elements, submit a form, read page source, ...
Someome got some snippet?
Cheers
I have an array : a=[[1,2],[3]]
and b=[[2,3],[5]]
i need to add corresponding elements in each array simultaneously in order to obtain the result;
result=[[3,5],[8]].
Thanks and Cheers!
Hi, I'm now using AxWebBrowser component to get DOM from web page and find used styles on each element. Unfortunatelly this is not working perfectly and some elements doesn't return correct data.
I'm thinking about if it's possible to use engine from firefox? Is there some dll library I can use, navigate to the page and go throw DOM of the page?
I have this code that has one "outerDIV" that contains an "innerDIV". On chrome the "innerDIV" size is 491px, whereas on IE it is 425px (same as outerDIV). Hence, on Chrome I can see the first two children of "innerdiv": "My test string #1" and "test2". But for IE I can only see the first child.
I am not quite sure what the "right" behavior should be, as firefox does the same as IE. However I would like to have IE do the same as Chrome.
I have been experimenting with some css styles (mainly overflow and display), but still can't make it right: IE will expand its height instead of its width to make the elements fit.
Can you guys help me figure out a way to change the css so that IE will wraps the div elements inline? As a restriction though, I cannot change the width on the HTML. As a benefit, I am using a css that only loads for IE to patch these kind of IE inconsistencies. The same css will NOT load for chrome, so I don't need to worry about messing with chrome when changing the IE CSS. Thanks in advance!
<html>
<head>
<style type="text/css">
<!--
body {
font-family: helvetica;
}
.myContainer {
overflow: hidden;
border: 1px solid rgba(0, 0, 0, .5);
font-size: 14pt;
height: 49px;
line-height: 49px;
overflow: hidden;
display: block;
}
.myContainer > DIV {
float: left;
white-space: nowrap;
display: block;
}
.myContainer .item:first-child {
padding-left: 10px;
}
.myContainer .item {
float: left;
padding-right: 32px;
}
-->
</style>
</head>
<body>
<div id="outerDIV" class="myContainer" style="display: block; width: 425px;">
<div id="innerDIV">
<div class="item">
--------My test string #1--------
</div>
<div class="item">
------test2-------
</div>
<div class="item">
test
</div>
</div>
</div>
</body>
</html>
Does Scala provide a built-in class, utility, syntax, or other mechanism for converting (by wrapping) an Iterator with an Iterable?
For example, I have an Iterator[Foo] and I need an Iterable[Foo], so currently I am:
val foo1: Iterator[Foo] = ....
val foo2: Iterable[Foo] = new Iterable[Foo] {
def elements = foo1
}
This seems ugly and unnecessary. What's a better way?
I'm developing a touchscreen application that, aside from everything else, records the amount of times the screen is used so that the user can be reminded to clean the screen after a predefined number of clicks.
I've got the click functions written nicely, all I need now is make sure the function is called on a click.
I imagine $('*').click(function() { //do something }); would accomplish my goal, but is that the best way? Also, would that overwrite other click functions assigned to the elements?
I have a dynamic array of strings, the elements of which I would like to localize. Is there a way to localize the strings without iteration e.g. something like using "makeObjectsPerformSelector". Thank you
Hi,
I need to control some script elements, that's why I want to add class attribute to do it.
But, w3c says that it's invalid. Some effect, if I add rel or id attribute.
Any other ideas how I can access appropriate script tag?
Doctype: XHTML 1.0 Strict
Thanks,
question: how can i bind the same vector, lets say o=c(1,2,3,4) mutiple times to get a matrix like
o=array(c(1,2,3,4,1,2,3,4,1,2,3,4), dim(c(4,3))
o
[,1] [,2] [,3]
[1,] 1 1 1
[2,] 2 2 2
[3,] 3 3 3
[4,] 4 4 4
in a nicer way then: o=cbind(o,o,o) and maybe more generalized (dublicate()??
I need this to specifiy colors for elements in textplot()
thx a lot