Yo!
If I have a div with a fixed height and width, which I am moving using keypress (or keydown/keyup). Can I get the window to "follow" that div?
I know you can auto scroll a page, but can you get the co-ordinates of a div and scroll the page as the div moves?
Cheers :)
...
Greetings,
my xul app needs to load scripts dynamically, for this I derived a function that works in regular html/js apps :
function loadScript(url)
{
var e = document.createElement("script");
e.src = url;
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
to something that ought work in XU...
How can I move my initialization code i.e.
<script type="text/javascript">
$(document).ready(function() {
var t; // This will be a timeout
$('.navHover').mouseover(function() {
if (t)
{
clearTimeout(t);
}
$('.navigation...
Hi all,
Does rails have a way to get JUST the src of an image as a string? I'm trying to embed the image on a third party site in javascript.
This is the general idea (widget.js.erb):
var widgetImage = new Image();
widgetImage.src = "<=% Some groovy ruby code to just get the image src as a string %>"
Any ideas?
...
So I have the error mentioned in the title when I try to build my web site through the file menu. The code that causes this is below (JavaScript that appears in the body tag):
if(editedRow != null)
{
var SundayLoc = $find("<%= FieldOpsScheduler_ctl00_ctl05_RCB_SunLocale.ClientID %>");
...
Firstly,
Is there a way for me to put variable declarations in a for loop?
E.g. the following:
var origh1 = $('#candidates img:eq(0)').height();
var origh2 = $('#candidates img:eq(1)').height();
var origh3 = $('#candidates img:eq(2)').height();
var origh4 = $('#candidates img:eq(3)').height();
var thumb1h = $('#candidates img:eq...
Hi Folks,
I need to send a base64 encoded string to a client. Therefore, I'm opening and reading an image file on the server, encode it and send that data along with the image/jpeg content-type to the browser.
Example in php:
$image = $imagedir . 'example.jpg';
$image_file = fopen($image, 'r');
$image_data = fread($image_file, fi...
As a new comer to writing front-end views with Rails, I'm a bit confused as to when I should be using rjs templates versus when I should be writing my own JavaScript to handle events/DHTML. Is there some rules you avid Rails developers follow for when something is too complex or not possible with RJS and you just write the JavaScript you...
Is there a way to select all elements that have a given style using JavaScript?
Eg, I want all absolutely positioned elements on a page.
I would assume it is easier to find elements by style where the style is explicitly declared:
the style is non-inherited (such as positioning)
the style is not the default (as would be position:sta...
I am retrieving a value from our DB using JSTL. I am inserting it right into some javascript to use it as a variable. I need the output of the value the JSTL is holding to be escaped because if there are single or double quotes it breaks my script. The value is user specified.
Example:
Doing the following:
<c:set var="myVar" value="Da...
Hey everyone!
I just started doing some Javascript work for a project, I do mostly backend work so I'm sorry for being new at this! Also, not using a Javascript framework because I want to learn about the fundamentals before making everything very easy for myself :)
So, here is my question/confusion: I wrote a little javascript that dy...
Hi,
I am trying to come up with a JS regex that will include any intranet site (with the simple definition of any host name that does not include .), but will exclude localhost.
I've got the first part: http(s)?\:\/\/[^\.\/]+(\/.*)*
I am struggling with the second part. Any help would be appreciated.
...
Hey!
I am making a homepage at the moment and I have made an edge around the "main page" with frameset... that was probably stupid, but now my JavaScript for some reason doesn't work?!
What I want to do is make a username and password protected page using javascript. The script itself is as follows:
function logIn(); {
var username ...
I'm trying to read the Flickr feed in order to parse the images. However, the images are in the media:thumbnail tag. Where would I begin to make a mediaRSS parser? Does anyone have an example?
...
So I'm making a Google Maps based webapp in JavaScript and a part of my code looks like this:
function revGeocode(marker){
var latlng = marker.position;
if (geocoder) {
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (result...
I want to delay things like the css from happening but this method wont work. Any ideas on how I can delay tasks.
$(function() {
$('.btn').click(function() {
$('.divOne').animate({"left": "+=400px"}, "fast").delay(800).css("background-color","yellow");
});
});
...
I need to enable selecting certain fragment of text in IE for further JS processing.
Unfortunately, IE has strange text selection behaviour - when you try to select text fragment that contains whitespace, IE will extend selection to the whole words, e.g. if you try to select (using your mouse) only: rem ips fragment from the sentence: L...
The JavaScript shown below inserts form input into a textarea at the current cursor position. The textarea id=mbentry. This works if all code is on the same page.
I want to have a hypertext link on page1.php open a little popup window (page2.php for example) so the user can enter text in the popup, close the window and have the input fr...
I've a userscript as the following:
document.addEventListener('click', alert('hello monkey'), true);
There were two problems:
"hello monkey" is alerted only when refreshing the browser, not work when clicking window.
using GM's 'manage user script' to edit the script, the change doesn't happen. (The source code on the local disc was...
hi
I am looking for a way to change the value what I passed to function once a button is pressed
<span id="showHidden" style=" margin-left:726px; position:relative; top:40;">
<input type="image" id="btnShowHidden" src/images/hide.gif" onclick="showHiddenRecords(1);" />
</span>
As you see in showHiddenRecords, its ...