I'm currently evaluation jQuery for a web site and it looks promising.
Yet jQuery is rather new and documentation is rather sparse IHMO,
especially for AJAX. I'm looking for working sample code which allows
to filter a list of elements (e.g. persons) through some input fields
(e.g. lastname,
I currently retrieve all pictures of my gallery with the following PHP
code
$files = getFiles ($d);
if (count ($files) 0) {
foreach ($files as $key = $f) {
echo img align=\center\ src=\$f\brbr;
}
}
simply adding picture after picture. But since there will be many more
On Apr 10, 11:58 pm, Jonathan Sharp [EMAIL PROTECTED] wrote:
Another approach would be to print out the images like:
echo img align=\center\ src=\$f\ style=\display: none;\
class=\photo\brbr;
Doesn't this load all the pictures right away? Since I expect soon a
few hundreds pictures I don't
As I understand $(document).ready() is more or less just an enclosure
to make sure the DOM is correcly available for use with jQuery. As it
seems this makes the use of any on... event handler obsolete since any
event can be bound in the $(document).ready() enclosure. Is that right
or is there
I've now reworked my sample and it finally loads picture after picture
yet it doesn't show them. My code is now
var files = new Array();
files = ?PHP echo $json-encode ($files) ?;
var pos = 0;
(pos 0)? $('#prev').show(): $('#prev').hide();
(pos (files.length-1))?
On 14 Apr., 20:18, wyo [EMAIL PROTECTED] wrote:
Okay found the mistake myself just after posting.
$('#files').html('img src='+files[pos]+'
$('#pictures').html('img src='+files[pos]+'
div id=pictures
echo img src=\$files[0]\ class=\picture\;
/div
O. Wyss
On 15 Apr., 14:28, boermans [EMAIL PROTECTED] wrote:
Adding a class may be preferable if you wish to provide further visual
cues (such as a border) to your clickable images.
$('#prev').addClass('clickable').bind('click', function() {...}
Nice.
And then in your css:
.clickable
On 16 Apr., 00:21, Brian Cherne [EMAIL PROTECTED] wrote:
Good point, Paul. Assuming it's not too much work, changing the IMG to an A
tag would take care of most your problems... You wouldn't need ugly js hacks
to get IE to understand hover and the only thing you'd need to do is
Okay but how
I've a dynamically created array
var folders = new Array();
folders = ?PHP echo $json-encode ($folders) ?;
and html created with
foreach ($folders as $key = $d) {
echo p id=\f$key\ class=\folder\$d/p;
}
and would like to bind a click handler to each
The javascript part looks alright to me. Is there any data in the
folders array on the client side when the script gets executed? Do you
have a sample page online?
Yes, http://www.orpatec.ch/index.php?page=gallery.php
Is there a way to retrieve the id of the bound element?
O. Wyss
On 21 Apr., 14:52, Giant Jam Sandwich [EMAIL PROTECTED] wrote:
Unless you need the unique ID for each paragraph, it might be easier
to bind the click by the class name. jQuery will perform the foreach
logic for you.
Well depending on which folder is clicked I'd like to switch to a
certain
On 21 Apr., 15:12, Giant Jam Sandwich [EMAIL PROTECTED] wrote:
Try this instead:
for (var i in folders) {
$('#f'+i).bind('click', function() {
alert ($(this).attr(id));
});
}
Perfect. Besides is it allowed to use just number as id's?
O. Wyss
On 17 Apr., 00:06, Jörn Zaefferer [EMAIL PROTECTED] wrote:
wyo schrieb: On 15 Apr., 18:27, Brian Cherne [EMAIL PROTECTED] wrote:
.hover is this a jQuery function? Where is it described?
http://jquery.bassistance.de/api-browser/#hoverFunctionFunctionhttp://docs.jquery.com/Events#hover
Sorry my question might be rather basic stuff but none of the
tutorials, sample code or API description helps me solving my
question.
I've a function cropImage which I'd like to use as a methode. What's
the correct syntax for
function cropImage () {
...
$(this).css
My cropping image function works just after loading the image but not
during window resizing. The problem is if there's a width=100%
somewhere in the page but no height=100%, enlarging vertical only
adds white space instead of cropping larger. Any size calculation
based on actual values fails so
I've done my first AJAX call but since the documentation isn't clear
about how parameter passing is done, it's not working on the first
try. My code
=
var files = new Array();
$.getJSON (getfiles.php,
{basedir: gallery},
function (data){
On 27 Apr., 20:38, Mike Alsup [EMAIL PROTECTED] wrote:
I've also just tried it out but where is upload.php?
As with any form processing, there must be a server component that
handles the data. upload.php is just the action target for
Massimiliano's form.
Oh, I though it would be nice to
I load images with
$('#pictures').html('img src='+files[pos]+' id=file'+pos+'
class=picture');
and want to save the loaded width,height afterwards. It seems this is
only possible after the image is fully loaded. Is there an event which
I could bind a function?
O. Wyss
What's the difference of $.getJSON versus $.get? I currently use
$.getJSON to load JSON data but I can't see any advantages.
Is $.getJSON just another way for
$.ajax({
type: GET,
url: link name,
dataType: json,
complete: function name
})
or is the callback excuted only when
On 28 Apr., 15:39, Sean Catchpole [EMAIL PROTECTED] wrote:
Try this:
$('#pictures').html(...).bind(load,function(){...});
I've tried
$('#pictures').html('img src=...').bind ('load', sizeImage);
function sizeImage() {
alert ('sizeImage');
}
The alert is never shown, see
On 28 Apr., 23:12, Mike Alsup [EMAIL PROTECTED] wrote:
var $img = $('img src='+files[pos]+' id=file'+pos+'class=picture')
.appendTo('#pictures')
.bind('load', function() { alert('loaded') });
Thanks, this works. Why do you use appendTo instead of html? I
must say I don't understand
On 28 Apr., 23:18, Erik Beeson [EMAIL PROTECTED] wrote:
Maybe $('#pictures').html(...).children().bind(...)
Amazingly this works, see http://www.orpatec.ch/gallery4.html
But I think you're trying to hard to use jQuery. How about this
(tested on FF2/Mac):
Possibly but I want to learn jQuery.
On May 4, 9:44 am, Giuliano Marcangelo
[EMAIL PROTECTED] wrote:
Otto,
seems fairly easy to me to download the js
http://menu.n2cms.com/Js/n2menu.js
Well it's just shown as text without any formating when I access the
link.
O. Wyss
I'm playing around with the form plugin yet when I press the submit
button only the result (in my case true is shown afterwards. The
full form is gone. My code is rather simple
script type=text/javascript
$(document).ready(function() {
var options = {
beforeSubmit:
On May 8, 11:33 pm, Aaron Heimlich [EMAIL PROTECTED] wrote:
Onhttp://www.orpatec.ch/termola/index.php?page=contact.phpFirebug gives me
the following error:
validateInput is not
definedhttp://www.orpatec.ch/termola/contact.php?page=contact.php
Line 30
Well that can't be the reason since
On May 9, 1:53 pm, Mike Alsup [EMAIL PROTECTED] wrote:
Both pages have the same problem with this line:
$('#kontakt_formular').ajaxForm (function() {alert (data[0]?
'success': 'failure')});
'data' is undefined here. If you bind a function to ajaxError you
should see an error. You need to
I'd like to disable a button (input element) after an action. So far I
can hide it
$('#kontakt_senden').hide();
input id=kontakt_senden type=submit value=abschicken
yet I don't know how to disable it. Does anybody know?
O. Wyss
My gallery including size fitting now works mosty (except with Firefox/
SeaMonkey) but I need to have a download indicator to show when the
download takes a little longer. I've seen Thickbox uses a
loadingAnimation.gif. Is there a general available download
indicator which I could use? Is this
I consider to embed a page from one domain into a page from another
domain with an iframe. Yet when I click a link inside the embedded
page, only the embedded part should be loaded without involving the
outer page. Does anybody know if I could do this with load()? Has
anybody already tried
I've a form with serveral submit buttons which should call quite some
different functions. Is there a way to overwrite the URL depending on
the submit button, calling separate server functions or do I have to
separate them on the server?
O. Wyss
On May 15, 3:25 pm, Scott Sauyet [EMAIL PROTECTED] wrote:
You could easily do this in JQuery, but then you have to realize that
the site would not work with Javascript disabled. Since you are going
to have to do server-side processing anyway, it doesn't seem that big a
deal to do the
Is it possible to pass additional parameters to the AJAX call? On my
page I have a get value (e.g. mode=1) which I'd like to pass to the
called server function. Or do I have to store the value in a hidden
input field so it's passed with the other fields?
O. Wyss
I'm not sure if I understand it right, does the form plugin move the
results back into the form fileds after the call succeeds? If yes how
has the results look like? If no, what's the best solution?
O. Wyss
I've tried to build a table collapser yet I've problems with the
statements
$('#collapser_'+i+', .expanding').bind('click', collapser_collapse
(i));
$('#collapser_'+i+', .collapsing').bind('click', collapser_expand
(i));
To me they look correct yet Javascript stops working. The source is
I've some functions which I'd like to use outside of jQeury in normal
HTML, e.g.
script type=text/javascript
$(document).ready(function() {
function collapse (i) {
$('#expanded_'+i).hide();
}
});
/script
...
img src=images/plus01.png onclick=javascript:
On Jan 31, 3:38 pm, Giovanni Battista Lenoci [EMAIL PROTECTED]
wrote:
wyo ha scritto:
Why don't you declare the function outside the document.ready ?
Since I want to use the function during startup but prevent it from
being used before document.ready and I want to use it afterwards.
Why
Isn't it possible to bind to a previous created object? I've the
following code
for (var i in data) {
$('#eintragsliste').append(
'trtdtabletbody' +
' tr' +
'tdimg class=expanding src=images/plus01.png/
th' +
'td.../td' +
On Feb 2, 5:06 pm, Glen Lipka [EMAIL PROTECTED] wrote:
http://brandonaaron.net/docs/livequery/
This will do the trick.
Perfect.
Yet if I rework the sample to bind each image separate, the script
takes for ages and the browser complains about stopping the script.
for (var i in data) {
maybe cutting that 'id=' ?
simply:
$('.expanding, #'+i+).
Unfortunately not since I've done this before. IMO the only solution
would be to use the onclick clause in HTML but I haven't figured out
to access jQuery from outside. E.g.
img class=expanding src=images/plus01.png onclick=$
On Feb 3, 5:39 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
Ugh ... large tables always needs lots of optimizations. First ...
you'll want to minimize the number of .append()s. Concat all your HTML
into an array and then append. Something like this:
var html = [];
...
Thanks.
cause issues
I'd like to read the initial values of the input fields from a DB (php
script) with ajaxSubmit. So far ajaxSubmit didn't fire the request to
my php script. See sample at
http://www.orpatec.ch/test/formdata.html (view source)
Is there a sample anywhere which does about the same? Besides how are
I've a form like
form id=Test ...
fieldset
table ...
tbody
tr
tdinput name=Prefix/td
Now I try to access it in the following way:
$('#Test, Prefix').value = 'Testing;
I also tried
$('#Test', 'Prefix').value = 'Testing;
with no success. Any idea what's wrong?
of value.
On Oct 14, 2:49 pm, wyo [EMAIL PROTECTED] wrote:
I've a form like
form id=Test ...
fieldset
table ...
tbody
tr
tdinput name=Prefix/td
Now I try to access it in the following way:
$('#Test, Prefix').value = 'Testing;
I also tried
43 matches
Mail list logo