<b>REGISTER</b>

GFX-Sector - Javascript & jQuery


 
GFX-Sector » Coding Area » Webentwicklung » Javascript & jQuery » JQuery Ui Slider mit File Tree Problem » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites

GFX-Sector - Your GFX-Source No. 1

  • √ kostenlose Mitgliedschaft
  • √ über 800 kostenlose Photoshop Tutorials
  • √ über 100 GB Photoshop-Ressourcen (Brushes, Render, PSDs, ...)
  • √ große und aktive Battle-Section
  • √ konstruktives Feedback zu GFX-Werken
  • √ einzigartiges Design
  • √ eines der größten Grafikplattformen in Deutschland
  • »»»JETZT KOSTENLOS REGISTRIEREN!«««

User Login



Javascript & jQuery

Probleme, Fragen oder sonstiges mit JavaScript, jQuery und co? Hier bist du richtig!
Post New Thread Post Reply

JQuery Ui Slider mit File Tree Problem

     Deutsche Version  English version
Author
Post « Previous Thread | Next Thread »

Mr. Tool Mr. Tool is a male
Pfadfinder

Spender


Mr. Tool hat kein Avatar

Registration Date: 17.06.2007
Posts: 531
Location: Österreich
Program: Photoshop CS2
Deviantart: verel

Spacer
JQuery Ui Slider mit File Tree Problem

JQuery Ui Slider mit File Tree Problem

      

Hi

Ich hab da mal so ein kleines Problem mit meinem Content Slider...

Also:

Ich versuche mit dem JQuery Ui Slider eine div box rauf und runter zu scrollen.
Wenn die div box eine bestimmte höhe besitzt funktioniert das ganze einwandfrei.

Fakt ist, das ich in die div box mit dem JQuery File Tree Plugin von http://abeautifulsite.net/2008/03/jquery-file-tree/ einen Ordner Baum anzeigen lasse wo man mit klick auf einen Ordner via Ajax die Unterordner/Dateien anzeigen lassen kann.

Wenn ich das ganze kombinieren will komm ich auf das Problem das wenn ich die Slider() function im Callback der SlideDown() function aufrufe er diese sofort ausführt und nicht nachdem die Animation zuende ist, daher wird in die Variable ein falscher Wert eingetragen und das ding funktioniert nicht.

Hier sind die beiden Scripts:

Slider Function
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function slider() {
	var scrollPane = $("#filetree"),
	    scrollableHeight = scrollPane.height() - scrollPane.parent().height() || 0;
	    
		alert(scrollableHeight);
		
	    $("#slider").slider({
	      orientation: "vertical",
	      range: "max",
	      min: 0,
	      max: scrollableHeight,
	      value: scrollableHeight,
	      slide: function(event, ui) {
	        scrollPane.css({top: ui.value - scrollableHeight});
	      }
	    });
}



Tree View
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
// jQuery File Tree Plugin
//
// Version 1.01
//
// Cory S.N. LaViska
// A Beautiful Site (http://abeautifulsite.net/)
// 24 March 2008
//
// Visit http://abeautifulsite.net/notebook.php?article=58 for more information
//
// Usage: $('.fileTreeDemo').fileTree( options, callback )
//
// Options:  root           - root folder to display; default = /
//           script         - location of the serverside AJAX file to use; default = jqueryFileTree.php
//           folderEvent    - event to trigger expand/collapse; default = click
//           expandSpeed    - default = 500 (ms); use -1 for no animation
//           collapseSpeed  - default = 500 (ms); use -1 for no animation
//           expandEasing   - easing function to use on expand (optional)
//           collapseEasing - easing function to use on collapse (optional)
//           multiFolder    - whether or not to limit the browser to one subfolder at a time
//           loadMessage    - Message to display while initial tree loads (can be HTML)
//
// History:
//
// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
// 1.00 - released (24 March 2008)
//
// TERMS OF USE
// 
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
// is copyright 2008 A Beautiful Site, LLC. 
//

function slider() {
	var scrollPane = $("#filetree"),
	    scrollableHeight = scrollPane.height() - scrollPane.parent().height() || 0;
	    
		alert(scrollableHeight);
		
	    $("#slider").slider({
	      orientation: "vertical",
	      range: "max",
	      min: 0,
	      max: scrollableHeight,
	      value: scrollableHeight,
	      slide: function(event, ui) {
	        scrollPane.css({top: ui.value - scrollableHeight});
	      }
	    });
}

if(jQuery) (function($){
	
	$.extend($.fn, {
		fileTree: function(o, h) {
			// Defaults
			if( !o ) var o = {};
			if( o.root == undefined ) o.root = '/';
			if( o.script == undefined ) o.script = 'jqueryFileTree.php';
			if( o.folderEvent == undefined ) o.folderEvent = 'click';
			if( o.expandSpeed == undefined ) o.expandSpeed= 500;
			if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
			if( o.expandEasing == undefined ) o.expandEasing = null;
			if( o.collapseEasing == undefined ) o.collapseEasing = null;
			if( o.multiFolder == undefined ) o.multiFolder = true;
			if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
			
			$(this).each( function() {
							
				function showTree(c, t) {
					$(c).addClass('wait');
					$(".jqueryFileTree.start").remove();
					$.post(o.script, { dir: t }, function(data) {
						$(c).find('.start').html('');
						$(c).removeClass('wait').append(data);
						if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').stop().height('auto').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
						bindTree(c);
					});
				}
				
				function bindTree(t) {
					$(t).find('LI A').bind(o.folderEvent, function() {
						if( $(this).parent().hasClass('directory') ) {
							if( $(this).parent().hasClass('collapsed') ) {
								// Expand
								if( !o.multiFolder ) {
									$(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
									$(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
								}
								$(this).parent().find('UL').remove(); // cleanup
								showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )));
								$(this).parent().removeClass('collapsed').addClass('expanded');
							} else {
								// Collapse
								$(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
								$(this).parent().removeClass('expanded').addClass('collapsed');
							}
						} else {
							h($(this).attr('rel'));
						}
						return false;
					});
					// Prevent A from triggering the # on non-click events
					if( o.folderEvent.toLowerCase != 'click' ) $(t).find('LI A').bind('click', function() { return false; });
				}
				// Loading message
				$(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
				// Get the initial file list
				showTree( $(this), escape(o.root));				
			});
		}
	});
	
})(jQuery);



hoffe mir kann da jemand helfen.

MfG
Mr. Tool


JQuery Ui Slider mit File Tree Problem 01.06.2010 11:22 Mr. Tool is offline Homepage of Mr. Tool Search for Posts by Mr. Tool

bpr bpr is a male
Spender


Avatar von bpr

Registration Date: 18.11.2007
Posts: 557
Location: London
Program: Zend Studio
Forums: Coding; International Section

Spacer
      

ohne einen einzigen kommentar im code wirst du wohl nicht viel hilfe erwarten koennen, da keiner so richtig weiß was du da machst und warum du das machst und was du erwartest was gemacht werden soll an welcher stelle, da ich nicht glaube, dass hier so viele diese plugins benutzen -es gibt eine vielzahl von jquery plugins und co...
von daher wuerde ich dich bitten, bei solchen sachen einen gute strukturieren und kommentierten code einzublenden

eine online demo waere auch sehr hilfreich -> umso mehr infos umso einfacher ist es zu helfen : ) es ist ja net so, dass wir net wollen - nur wollen wir es ein wenig einfacher haben und das leben nicht durch faulheit von anderen menschen verschwert bekommen smile

danke fuers verstaendnis




Freude
JQuery Ui Slider mit File Tree Problem 04.06.2010 23:21 bpr is offline Homepage of bpr Search for Posts by bpr

Mr. Tool Mr. Tool is a male
Pfadfinder

Spender


Mr. Tool hat kein Avatar

Registration Date: 17.06.2007
Posts: 531
Location: Österreich
Program: Photoshop CS2
Deviantart: verel

Thread Starter Thread Started by Mr. Tool
Spacer
      

joa verstanden.

naja ich habs jetzt mittlerweile mit nem setTimeout(); gemacht und es funktioniert.

Falls weiterhin probleme auftauchen kommentier ich etwas mehr XD



JQuery Ui Slider mit File Tree Problem 06.06.2010 15:28 Mr. Tool is offline Homepage of Mr. Tool Search for Posts by Mr. Tool
 
Spacer
   
GFX-Sector
unregistered


 hat kein Avatar


Spacer

Have you enjoyed this topic?


If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.

After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.

In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.

Sign up now and enjoy the advantages as a registered member.

(This website will be ad-free after a complete free sign up.)

New Post 06.06.2010 15:28  
Tree Structure | Board Structure
Post New Thread Post Reply
GFX-Sector » Coding Area » Webentwicklung » Javascript & jQuery » JQuery Ui Slider mit File Tree Problem

Similar topics to JQuery Ui Slider mit File Tree Problem
Thread
Top will auch mitmachen [Abgelehnt] (Forum: Epic Arts)
Slicen und Coden Problem (Forum: HTML, CSS)
das erste was ich je mit photoshop geamcht hab (Forum: Signaturen/Avatare)
Was kann man damit machen? (Forum: Tutorial Suche)
ein battle mit pommes bitte (Forum: Battle-Anfragen)