Jump to content

Recommended Posts

Well I am trying to use the mootools fx.slide to get some content to come out when a button is pushed.

 

It is currently not working and I am really bad with java etc. I am really good with html and php. How do I get this script to work?

 

I added the mootools library as so:

<script type="text/javascript" src="scripts/mootools-core-1.3.1-full-compat.js"></script>

 

I also put this in:

	<script type="text/javascript">
	window.addEvent(\'domready\', function() {

	  var status = {
		\'true\': \'open\',
		\'false\': \'close\'
	  };

	  // -- vertical

	  var myVerticalSlide = new Fx.Slide(\'vertical_slide\');

	  $(\'v_slidein\').addEvent(\'click\', function(event){
		event.stop();
		myVerticalSlide.slideIn();
	  });

	  $(\'v_slideout\').addEvent(\'click\', function(event){
		event.stop();
		myVerticalSlide.slideOut();
	  });

	  $(\'v_toggle\').addEvent(\'click\', function(event){
		event.stop();
		myVerticalSlide.toggle();
	  });

	  $(\'v_hide\').addEvent(\'click\', function(event){
		event.stop();
		myVerticalSlide.hide();
		$(\'vertical_status\').set(\'text\', status[myVerticalSlide.open]);
	  });

	  $(\'v_show\').addEvent(\'click\', function(event){
		event.stop();
		myVerticalSlide.show();
		$(\'vertical_status\').set(\'text\', status[myVerticalSlide.open]);
	  });

	  // When Vertical Slide ends its transition, we check for its status
	  // note that complete will not affect \'hide\' and \'show\' methods
	  myVerticalSlide.addEvent(\'complete\', function() {
		$(\'vertical_status\').set(\'text\', status[myVerticalSlide.open]);
	  });


	  // -- horizontal
	  var myHorizontalSlide = new Fx.Slide(\'horizontal_slide\', {mode: \'horizontal\'});

	  $(\'h_slidein\').addEvent(\'click\', function(event){
		event.stop();
		myHorizontalSlide.slideIn();
	  });

	  $(\'h_slideout\').addEvent(\'click\', function(event){
		event.stop();
		myHorizontalSlide.slideOut();
	  });

	  $(\'h_toggle\').addEvent(\'click\', function(event){
		event.stop();
		myHorizontalSlide.toggle();
	  });

	  $(\'h_hide\').addEvent(\'click\', function(event){
		event.stop();
		myHorizontalSlide.hide();
		$(\'horizontal_status\').set(\'text\', status[myHorizontalSlide.open]);
	  });

	  $(\'h_show\').addEvent(\'click\', function(event){
		event.stop();
		myHorizontalSlide.show();
		$(\'horizontal_status\').set(\'text\', status[myHorizontalSlide.open]);
	  });

	  // When Horizontal Slide ends its transition, we check for its status
	  // note that complete will not affect \'hide\' and \'show\' methods
	  myHorizontalSlide.addEvent(\'complete\', function() {
		$(\'horizontal_status\').set(\'text\', status[myHorizontalSlide.open]);
	  });
	});
</script>

 

Then i try to implement with this:

echo '<div class="profile_top_menu">';

	echo '
		<h3 class="section">Horizontal</h3>
		<div class="marginbottom">
			<a id="h_slideout" href="#">slide out</a> |
			<a id="h_slidein" href="#">slide in</a> |
			<a id="h_toggle" href="#">toggle</a> |
			<a id="h_hide" href="#">hide</a> |
			<a id="h_show" href="#">show</a> |
			<strong>status</strong>: <span id="horizontal_status">open</span>
		</div>

		<div id="horizontal_slide">
			asdfasdfasdfasdfasdf
		</div>
	';

Link to comment
https://forums.phpfreaks.com/topic/230304-mootools-fxslide/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.