LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2009, 05:17 AM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
moohelp for mootools? (javascript+php)


Hello all,

I am trying to use mootools: http://mootools.net/ to enlarge search results on a php page like in this example: http://demos.mootools.net/Mouseenter


However if the results return say 100 results the search will span this across 5 pages, if you scroll on to the next set of results the dropdown stops working I have modified the code to loop over the element names to create the event for each search result, but it still only works for the first page of results:

Code:
window.addEvent('domready', function()
	{
	for( i=0; i<100; i++ )
		{
		// The same as before: adding events
		$('table_'+i).addEvents(
			{
			'mousedown': function(){
				// Always sets the duration of the tween to 1000 ms and a bouncing transition
				// And then tweens the height of the element
				this.set('tween', {
					duration: 1500,
					transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
				}).tween('height', '200px');
			},
			'mouseleave': function(){
				// Resets the tween and changes the element back to its original size
				this.set('tween', {}).tween('height', '20px');
			}
			});
		}
	});
 
Old 08-09-2009, 07:57 AM   #2
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Original Poster
Rep: Reputation: 30
I suppose another question would be is it possible to use the getElementById and create the new event by passing the elementID for example:

Code:
function( nameofelement )
{
...
something.addEvent(......
...
}
The only problem I can foresee is that the addEvent is attached to the 'window':
Code:
window.addEvent('domready', function()
	{
	// The same as before: adding events
	$('myExpand').addEvents(
		{
		'mousedown': function()
			{
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', 
				{
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
				}
				).tween('height', '200px');
			},
		'mouseleave': function()
			{
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '100px');
		}
		});
	});
Much thanks in advance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript and PHP frameworks desertwebdesigns Programming 1 03-31-2009 08:02 AM
combining JavaScript and PHP mohtasham1983 Programming 6 07-03-2006 07:01 PM
PHP,JAVASCRIPT and CheckBox aznita Programming 2 06-17-2005 04:33 AM
PHP and JavaScript Gerardoj Programming 4 04-22-2004 02:02 PM
PHP and or Javascript Can they be used the same way? ElementNine Programming 1 03-05-2004 08:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration