TalkPHP
 
 
Account Login
Latest Articles
» How to keep your forms from double posting data
» cURL Basics
» Securing your PHP applications Part 1
» The way the function rolls
» Database Abstraction with Zend_Db - Part 2
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 05-08-2008, 06:58 PM   #1 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default Looking for a script

Okay, Ajax is something I know very little to nothing about at this point. I know the basics, but I don't know javascript for a damn, so I'm hoping there's an open source script somewhere I can use.

I have two columns, set width, set height. Links in the first, text content in the second. I need something, using jquery, or mootools or completely standalone, I don't care, that'll let me click a link in the first column, and it will update the content in the second.

Anybody know where I can find this? Thank you in advance,
-m
delayedinsanity is offline  
Reply With Quote
Old 05-08-2008, 07:07 PM   #2 (permalink)
The Contributor
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 51
Thanks: 12
buildakicker is on a distinguished road
Default

Like this?

mootools demos - Ajax and More options
__________________
NorCalPublicNews
3wpros
buildakicker is offline  
Reply With Quote
Old 05-08-2008, 07:39 PM   #3 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

More like this, but preferably using jquery as I'm already using jquery's lightbox... sorry should've mentioned that.
-m
delayedinsanity is offline  
Reply With Quote
Old 05-08-2008, 07:52 PM   #4 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

Think I found what I needed..
delayedinsanity is offline  
Reply With Quote
Old 05-08-2008, 07:58 PM   #5 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

ok so you have 2 columns:

HTML Code:
<div id="col1"></div>
<div id="col2"></div>
in column1 you will have this link: <a href="loadpage('info.php')">click me</a>

And before this (maybe just after the jquery.js include) you should make this function:

HTML Code:
function loadpage(page)
{
   $.get(page, function(data) { 
                 $('#col2').html(data);
               }
   );
}
This should work, as it gets info.php page and puts it's contents into #col2.
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 05-08-2008, 08:24 PM   #6 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

Seriously, it's that simple?

I haven't gotten to my Ajax class yet. That's ridiculous, haha.
-m
delayedinsanity is offline  
Reply With Quote
Old 05-08-2008, 08:26 PM   #7 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

it's simple, that's using jquery. :)
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 05-08-2008, 08:56 PM   #8 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 221
Thanks: 2
Jim is on a distinguished road
Default

I fix the problem like this in my websites:

Code:
// Vergroot div's hoogte wanneer een andere div hoger is
function changeDiv() {
	
	// Div's hoogte's
	var contentDiv    = document.getElementById('mainContent'); 
	var contentHeight = document.getElementById('mainContent').offsetHeight;
	var browserWindow = document.documentElement; 	
	var menuDiv       = document.getElementById('menu'); 
	
	// Client window
	var clientWindowHeight = browserWindow.clientHeight - 130;
	
	// Grootste hoogte?
	var size = Math.max(clientWindowHeight, contentHeight);
	
	// Set height
	//contentDiv.style.height = size+'px';
	//menuDiv.style.height = size+'px';
	
}

window.onload = changeDiv;
window.onresize = changeDiv;
Should be pretty simple even while the comment is in dutch (since im dutch)

The place where you see -130, is my height of the header. I design my sites like this:

- overall wrapper with optional BG

- header

- col 1
- col 2

- close wrapper

If you choose to use my code and dont get it, don't hestitate mailing me (jim at combined-minds.net)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:22 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0