I'm trying to curve text this effect using CSS3, HTML Canvas, or even SVG (see image below for example)? Is this possible? If so, how can I achieve this effect?
I'm trying to iterate through an array of elements. jQuery's documentation says:
jquery.Each() documentation
Returning non-false is the same as a continue statement in a for loop, it will skip immediately to the next iteration.
I've tried calling 'return non-false;' and 'non-false;' (sans return) neither of which skip to the next iteration. Instead, they break the loop. What am i missing?
So, here is the function for pre-filtering "CHILD":
function(match){
if ( match[1] === "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
}
The code is extracted from line 442-458 of sizzle.js.
So, why is the line var test = ..., have the exec inputing a boolean? Or is that really a string?
Can someone explain it by splitting it into a few more lines of code?
i have following format of json in which i want to asscess 0.4 , kem , 2 , 2000 values
but it seems it doesn't have name index so how one can access it in jquery.
when i paste following code in json viewer then i am getting numerical index for 0.4 , kem , 2
"td": [
{
"@attributes": {
"class": "odd"
},
"span": [
"3",
"7"
]
},
"0.4",
"Kem",
"24\/04\/2010",
"2000",
"2",
"14000",
"Good",
"Buckley",
"56.0",
"2:05.32",
"36.65",
"54.5"
]
}
I have a cross-domain POST request to http://api.local/user/auth - my API endpoint. I allow Cross Domain requests in my api with CORS. Using Chrome if that makes a difference.
I get a valid server JSON response with 200 Status Code but I am using deferreds from a backbone model like so:
@model.save()
.fail(-> console.log 'sync fail')
.success ->
console.log 'sync OK'
And I consistently get a 'sync fail' instead of the expected 'sync OK'
Thoughts?
At a website, I found the following code to make a jQuery plugin:
(function($){
// Our code here...
})(jQuery);
I don't understand how the code above works. What I understand is that the code executes immediately because the very last () in function(){}(). So the entire code says that is an anonymous function that is run immediately.
But I don't understand why the wrapping needs to pass jQuery and that inside it needs $ to be passed.
From my understanding, $ is an alias to jQuery, meaning practically the same. What is the meaning of $ and jQuery here? How does the overall code work as a jQuery plugin?
Hey, say I have a text node via XPath. How would I replace the text node with a new DOM node? For example, this little patch of code will go through text nodes, and if text matches something, it will replace it with a corresponding image via img element.
I wanted something faster then a global page regex or even a element innerHTML regex. Any help would be appreciated.
EDIT: Never mind. I figured it out.
I am wondering what the idiomatic way to render special language characters is using Handlebars.js templates. When I render the normal html I can use something like the Spanish lowercase e, é, and it renders as expected. When I pass the same text as a string to my Handlebars template I just see the characters é.
I have tried creating a Handlebars helper that used jquery to render the text using .html() then returning the .html() of the tmp element and I get the same results.
Suppose I have a simple XHTML document that uses a custom namespace for attributes:
<html xmlns="..." custom:xmlns="http://www.example.com/ns">
...
<div class="foo" custom:attr="bla"/>
...
</html>
How do I match each element that has a certain custom attribute using jQuery? Using
$("div[custom:attr]")
does not work. (Tried with Firefox only, so far.)
I'm trying to build a sort of resource allocation form. I'd like to be able to print a table from a database, and then allow users to click on each cell that they would like to reserve. Also, being able to drag and select multiple cells. Then send all of this via $_POST to another php script.
Problem is, I have no idea where to start.
Any suggestions?
Backspace is the browser hotkey for Navigate Back To The Last Page. I know that when an input has the focus this hotkey is disabled. But I have keyup and keydown events binded to this input, and something I wrote is causing this trouble.
Do you know the solution?
I know that the live() event handles event bubbling different than all other jQuery events. jQuery recommends using 'return false', but in my case that doesn't work.
The issue is:
I have a DIV which contains an anchor tag.
The DIV is bound using live(). Whenever I click the anchor tag inside this DIV it bubbles and calls the DIV's event. If I bind an event to that A tag which returns false it prevents the link from opening. Neither stopPropagation() or return false work in this case. Are there any other options? Ideally I'd like to keep the live() event around.
I'm trying to setup the Jquery plugin SerialScroll with Ariel's added keyboard controls.
I'm calling these three JS files:
serialScroll.js
scrollTo.js
keyboard.js (the keyboard control snippet)
Html I'm trying to manipulate. Want it to jump from ind-photo to ind-photo on arrow left and right.
<div id="photos">
<div class="ind-photo"><img src="2.jpg" /></div>
<div class="ind-photo"><img src="3.jpg" /></div>
</div>
I can't get it to work at all. I know there are likely slight things that are going to be off, but this isn't working at all.
Thanks in advance.
I am working with d3.js for rendering my graphs. For some reason, I am not a huge fan of svg title because of the delay it incurs and the inability to style them. Please do correct me if I am wrong. I recently came across, tipsy but it does not seem to be cross-browser compatible.
For instance, consider this. The tooltips work just fine in Firefox and Chrome but do not appear even in IE 9 and I'm not sure what's going on. Is there a cleaner cross-browser approach for tooltips compatible with d3.js other than using the svg title attribute?
Hello, I've made a slider that uses the left and right arrow keys to move the slide but when pressed to quickly it will bug a little and I was wondering if it's possible to limit the amount of presses in say a second. You can see it here: {link}
$('#slider-nav div').click(function() {
$('#slider-nav div').removeClass('selected').addClass('');
$('#slider-nav div:eq('+($.jcarousel.intval($(this).text())-1)+')').addClass('selected');
})
// Allow left and right keys to control slider
$(document.documentElement).keypress(function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
var direction = null;
// handle cursor keys
if (code == 37) { // left key
direction = 'prev';
}
else if (code == 39) { // right key
direction = 'next';
}
if (direction != null) {
$('#slider-nav div.selected')[direction]().click();
}
});
I have implemented column resizing with YUIs DataTable as demonstrated in this example:
http://developer.yahoo.com/yui/examples/datatable/dt_complex_clean.html
Is there anyway to enable column resizing without column moving?
I was asked to implement a menu bar that is neither horizontal nor vertical. Here are two example buttons:
This is something new to me, so to learn how to make this work I'm looking for a site (or better yet, a tutorial) that uses a similar menu bar. Any ideas?
Hey Guys,
I had made website. This is Link for that.
There is one menu in this site which works well in Firefox , Chrome, Opera.
But it is messed in the IE 6.
I want to know why is not showing correctly?
I'd like to have a div expand to show contents when a user clicks their mouse in a text box to enter text. I haven't seen that around anywhere before. I know how to make things expand onClick, but can someone point me to what I'm looking for?
Basically, I have an email signup box that I just want to show the input field for the email address, but if the user actually decided to get on the email list, that div will expand to also ask them for their name and zipcode.
Thanks!
I've got jquery already set for the email form now, so I'd like to expand on that if possible:
I would like to keep the contents of large UI lists cached on the client, and updated according to criterial or regularly. Client side code can then just fill the dropdowns locally, avoiding long page download times.
How can I go about this? I mean, what patterns and strategies would be suitable for this?
I am currently working on a project where I have to make an agent to interact with a server.
Each 50ms, the server will receive the last thing I outputted to System.out and send me a new set of lines as a 'state' through the System.in printstream to analyze and send my next message to System.out.
Also, if the server receives multiple outputs from me, it only regards the most recent one.
..
As for my question:
My program originally constructed a tree and then analyzed each leaf node to see which would be optimal, and then waited around for the next input, but I can recursively do a deeper tree search that would make my output 'better' (and again and again to keep returning a better result).
Using this and the fact that if the server receives multiple outputs, it only takes the most recent one, I could do each level, print my result and start the next level. But here comes my problem...
I can't be stuck in some complex algorithm while I am supposed to receiving the next input as I will then miss it. So I was wondering if there is a way to cancel anything else I am doing when I receive something via System.in and then go back to the beginning of the function and start the search again with the new set of input (and rinse and repeat..)
I hope this all makes sense,
Thank ye all
Looking at this jQuery example, how can I modify the code so that it only changes the color of the cell if the value of the submit button in that cell is a certain value.
i.e.-
var submitEl = $("td :submit")
//Only do the below if the submit buttons value is "XYZ"
.parent('td')
.css({background:"yellow", border:"3px red solid"})
What I have to work with:
An html table 5X7. On many queries, there are less that 35 items filling the complete table.
How can I "hide" the empty cells dynamically in this case, using jQuery (or any other efficient way)?
Thank you.
Hi, all,
I tried to put the module "LearnBoost's Socket.IO-Node", all works, except event 'onClientMessage'
Tell, in what there can be a problem, thanks!
...sorry for my english
io.listen(server, {
onClientConnect: function(client){
client.send(json({ buffer: buffer }));
client.broadcast(json({ announcement: client.sessionId + ' connected' }));
},
onClientDisconnect: function(client){
client.broadcast(json({ announcement: client.sessionId + ' disconnected' }));
},
onClientMessage: function(message, client){
var msg = { mess: [client.sessionId, message] };
buffer.push(msg);
if (buffer.length > 15) {
buffer.shift();
}
client.broadcast(json(msg));
}