I have an li navigation with dividers created using the code shown below. I'd like to have two of these | elements but different colours, is it possible to define different colours for both?
#navigation li:before {
content: "|";
color: #800836;
}
I'd like another but with #F2659A and right next to the existing.
Here is the live url to see how things look right now:
http://www.jordancharters.co.uk/nakedradish/
If I have a selector like
$.('.active');
How can I see how many items that matched?
Alternatively, is there an easy way to see if more than zero elements were matched?
if a have a declaration like
theclass = Classroom.objects.get(classname = classname)
members = theclass.members.all()
and i want to display all the members(of a class) in a template, how should i do it??
if i write:
{{theclass.members.all}}
the output is an empty list(though the class has some members)
How should the elements of a m2m table be displayed in a template?
thanks!
Hey
I have to search through a list and replace all occurrences of one element with another. I know I have to first find the index of all the elements, and then replace them, but my attempts in code are getting me nowhere. Any suggestions?
I have several values I'm rendering as elements on my template and I want to further this by having them arranged into equal (or near-equal columns) automatically in the template. How can I achieve this?
So far I'm rendering all the values as
<ul>
{% for feature in features %}
<li>{{ feature }}</li>
{% endfor %}
</ul>
I've something like this
Object[] myObjects = ...(initialized in some way)...
int[] elemToRemove = new int[]{3,4,6,8,...}
What's the most efficient way of removing the elements of index position 3,4,6,8... from myObjects ?
I'd like to implement an efficient Utility method with a signature like
public Object[] removeElements(Object[] object, int[] elementsToRemove) {...}
The Object[] that is returned should be a new Object of size myObjects.length - elemToRemove.length
How do I retrieve all elements after the first one starting with a "-" using linq?
var arr = new[] {"-s1", "-s2", "va", "-s3", "va2", "va3"};
var allElementsAfterVA = from a in arr where ???? select a;
I want allElementsAfterVA to be "-s3", "va2", "va3"
How can I find all elements on a page which have a color of "blue"?
alert($("* [color=blue]").attr("id"));
The above example does not work. Please recognize that color is a CSS attribute. I'm certain it is possible I just cannot figure out the correct method to do so.
hey all
i am trying to aggregate form elements into object and then send it via ajax here is the code that i start using but i cant figure out how to do the rest
$('.jcart').live('submit', function() {
});
private class CompAdvertisements : IComparer<Advertisements>
{
private string OrderBy { get; set; }
public CompAdvertisements(string orderBy)
{
OrderBy = orderBy;
}
#region IComparer<Advertisements> Members
public int Compare(Advertisements x, Advertisements y)
{
return x.Country.Name.CompareTo(y.Country.Name);
Can i also user x.Name.CompareTo(y.Name); in comparer that i will compare with two elements lik order by something and order by something2
Dear all,
I'd like to know how to create draggable elements using jQuery UI that once they are dragged and dropped into another container, regenerate the same item. For example, I can drop a button from container A to container B, and once I do that, the same button (a clone) re-emerges in container A.
Thanks in advance.
Hello all.
I've done some experimenting, but can't seem to successfully bind one event handler to multiple elements using jQuery. Here's what I've tried:
$('selector1', 'selector2').bind('click', function() {
$('someSelector').removeClass('coolClass');
});
I've tested all my selectors, and they are all valid.
Is what I'm trying to do even possible? If so, can I do it with .live() as well?
Thanks!
Hi,
What is your opinion about using non valid attributes on html elements for easier jQuery selectors etc ?
Eg.
<div name="myDiv"></div>
According to Visual Studio the name attribute is not valid for a div element.
I have multiple pages being pulled together into a single page. Some of these individual pages have their own html, head, and body elements. Is it detrimental to the performance of the page to have these? It seems that the DOM is correct (only has a single of each element) in FireBug.
It is convenient for me to use a set. I like how I can "add" ("remove") an element to (from) the set. It is also convenient to check if a given element is in the set.
The only problem, I found out that I cannot add a new element to a set if the set has already such an element. Is it possible to have "sets" which can contain several identical elements.
Consider I have an array of elements out of which I want to create a new 'iterable' which on every next applies a custom 'transformation'. What's the proper way of doing it under python 2.x?
For people familiar with Java, the equivalent is Iterables#transform from google's collections framework.
I want to check the elements above the main diagonal and if I found non zero values , count one.
If the non zero values are found in the same column ,then count just one ,not the number of the non zero values.
For example , it should be count = 2 and not 3 in this example because 12 and 6 are in the same column.
A=
1 11 12
4 5 6
0 7 0
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main( int argc, const char* argv[] ){
int Rows = 3 , Cols = 3;
float *A = (float *) malloc ( Rows * Cols * sizeof (float) );
A[0] = 1.0;
A[1] = 11.0;
A[2] = 12.0;
A[3] = 4.0;
A[4] = 5.0;
A[5] = 6.0;
A[6] = 0.0;
A[7] = 7.0;
A[8] = 0.0;
// print input matrix
printf("\n Input matrix \n\n");
for ( int i = 0; i < Rows; i++ )
for ( int j = 0; j < Cols; j++ ) {
printf("%f\t",A[ i * Cols + j ]);
if( j == Cols-1 )
printf("\n");
}
printf("\n");
int count = 0;
for ( int j = 0 ; j < Cols; j++ )
{
for ( int i = ( Rows - 1 ); i >= 0; i-- )
{
// check the diagonal elements above the main diagonal
if ( j > i )
{
if ( ( A[ i * Cols + j ] != 0 ) )
{
printf("\n Above nonzero Elmts = %f\n",( A[i * Cols + j] ) );
count++;
}
}
}
}
printf("\ncount = %d\n",count );
return 0;
}
Hi All,
I am using <script> inside the body tag.
<script type="text/javascript" language="javascript">
$('#audioVolume').text($('#audioVolume').text(Math.round((document.mediaPlayer.Volume + 2000) / 10) + "%"));
</script>
Error: Microsoft JScript runtime error: 'undefined' is null or not an object.
Need: I want to access the html elements in <script inside the body tag.
def common_elements(list1, list2):
"""
Return a list containing the elements which are in both list1 and list2
>>> common_elements([1,2,3,4,5,6], [3,5,7,9])
[3, 5]
>>> common_elements(['this','this','n','that'],['this','not','that','that'])
['this', 'that']
"""
for element in list1:
if element in list2:
return list(element)
Got that so far, but can't seem to get it to work! Thanks
re,
I have a simple query that works:
$("#test fieldset input").each(function() { })
However, I want to select "input" and "select" elements without having to write 2 "each" queries. Is this possible?
thanks.
Am unable to add elements to a dropdown list via Javascript.
The below piece of code works in IE and Chrome, but not in firefox.
ddlId.add(new Option("",0));
In firefox, I keep getting an 'Not enough arguments' exception. Any idea on how to resolve it? Thanks
Pretty simple i'm sure, but..
I've got a file that is guaranteed to have only an <h1some text</h1 and a <psome more text</p in it.
How would i go about returning these to elements as separate variables?