Sliding Panels Navigation Question
I'm using the sliding panels widget to display some image
thumbnails. The problem is, I'm displaying about 5 or so at a time,
and the showNextPanel function only moves the whole thing over by
one thumbnail, making it necessary to click it five times to show
the next set of thumbnails.
Mangled test file can be found
here.
Hello Luke,
I see there are 3 problems here you want/have to solve:
1. On page load you try to animate an element in page that
doesn't exists: thimbContainer. Every time you load the page in the
browser 3 alerts that the element is not found are generated by the
Spry Effects because the element isn't there. Please remove the
following code from the onload attribute attached to the body tag:
MM_effectAppearFade('thumbContainer', 2000, 0, 100, false);
2. The move next arrow doesn't work on the first click. The
problem appears because the SlidingPanel widget is instantiated
before the data to be putted in place in your page by the ds1 XML
DataSet. The regions are populated on page finish with the data but
the SlidingPanel widget will still try to animate the old,
incorrect element on the first click. To avoid this problem you'll
have to remove from page the SlidingPanel instantiation and
register a listener on the 'ticker' region update. Remove this
code:
<script type="text/javascript">
var sp = new Spry.Widget.SlidingPanels("ticker");
</script>
and just after the ds1 DataSet instantiation add the
following line:
Spry.Data.Region.addObserver('ticker',
{onPostUpdate:function(){sp = new
Spry.Widget.SlidingPanels("ticker");}});
3. To move the slider with the next 5 or prev 5 elements
you'll have to create your own functions that should add or
subtract from the current display index 5. The functions you look
for are:
function moveNextFive(){
if (!sp)
return;
var idx = sp.getContentPanelIndex(sp.currentPanel) + 5;
var maxPanels = sp.getContentPanels().length;
if (idx > maxPanels)
idx = maxPanels;
sp.showPanel(idx);
function movePrevFive(){
if (!sp)
return;
var idx = sp.getContentPanelIndex(sp.currentPanel) - 5;
var minPanels = 0
if (idx < minPanels)
idx = minPanels;
sp.showPanel(idx);
Please change the onclick for the previous and next arrows in
your Sliding Panels with calls to these 2 functions.
Regards,
Cristian
Similar Messages
-
Hello,
Got the sliding panels working fine however I am wondering if it is possible to change the navigation slightly.
Currently I am navigation between the pabels using previous and next buttons such as:
<a href="#" onclick="sp1.showNextPanel(); return false;">Next</a>
<a href="#" onclick="sp1.showPreviousPanel(); return false;">Previous</a>
However when you are at either the first panel and click previous or the last panel and next the buttons obviously don't do anything. Is there any code than can be added so that when you are at the first panel and click previous the last panel is navigated to and vise versa on the last.
Here is an example of what I mean:
http://www.panic.com/coda/
Any ideas?Sure,
You can modify the SlidingPanels showNext and prev methods like this:
Spry.Widget.SlidingPanels.prototype.showPreviousPanel = function()
var index = this.getContentPanelIndex(this.currentPanel) - 1;
return this.showPanel(index < 0 ? this.getContentPanels().length -1 : index);
Spry.Widget.SlidingPanels.prototype.showNextPanel = function()
var index = this.getContentPanelIndex(this.currentPanel) + 1
return this.showPanel(index >= this.getContentPanels().length ? 0 : index);
And it should work
(either change them in SprySlidingPanels.js file, or just add them in a script block under the SprySlidngPanels script) -
Hi there. I'm new to Spry, and I'm using 1.6.1 in Dreamweaver CS3. I want to create sliding panels to showcase some work I've done, but I wanted to know if it's possible to build a scroll function for one panel which will have multiple pieces of work (not a scrollbar).
There's not enough horizontal real estate to show all the work in this particular panel at once, so I want to put a "continue" or "next" and a "previous" button/function on that panel so the user can automatically view differents areas of the panel to see the rest of the related work, without creating a number of different panels for all this.
Is this possible in the sliding panels widget, or is there just one pass per panel? I hope my question is clear.
I'm trying to decide whether to build this in Spry or Flash.
Thanks in advance for any suggestions.
LI dug around a bit more and saw an example that shows me that I can do this. Thanks anyway!
-
How do i style an inactive navigation for sliding panel?
How can i style my navigation when they are not active(for example i would like to style my "previous" navigation arrow in a specific manner when there is no previous content to show)
With great difficulty. We must first determine the current panel and then, if the current panel is 0 then the previous button has to be changed and if the current panel matches the total number of panels, the next button has to be changed.
The following is a complete document that will work. Make sure you have all of the support (read JS) files in the allocated directory.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sliding Panels Example.</title>
<script src="SpryAssets/SprySlidingPanels.js" language="javascript" type="text/javascript"></script>
<script src="SpryAssets/SpryDOMUtils.js" type="text/javascript"></script>
<link href="SpryAssets/SprySlidingPanels.css" rel="stylesheet" type="text/css" />
<style>
.SlidingPanelsContentGroup {min-height:0;}
.disabled {color:#F00;}
</style>
<script>
function slideNextPanel() {
sp1.showNextPanel();
var currentPanel = getCurrentPanel();
var panelCount = sp1.getContentPanelsCount()-1;
if (currentPanel==panelCount) {
Spry.$$("a#nextPanel").addClassName("disabled");
} else {
Spry.$$("a#previousPanel").removeClassName("disabled");
function slidePreviousPanel() {
sp1.showPreviousPanel();
var currentPanel = getCurrentPanel();
if (currentPanel==0) {
Spry.$$("a#previousPanel").addClassName("disabled");
} else {
Spry.$$("a#nextPanel").removeClassName("disabled");
function getCurrentPanel() {
var className = 'SlidingPanelsContent'; //change the className that is on all your content panels..
var panelCount = sp1.getContentPanelsCount();//get panel length
var current = sp1.getCurrentPanel(); //get current panel
var group = sp1.getContentGroup(); //get our group
var panelNumber = 0;
if(group.hasChildNodes()){
var j = 0;
for(var i = 0, l = group.childNodes.length; i < l; i ++){
if(group.childNodes[i].className && group.childNodes[i].className.search(new RegExp("\\b" + className + "\\b")) != -1){ // if it has SlidingPanelsContent class we found the correct node.
if(group.childNodes[i] == current){ // if it matches our current panel, we have a number
panelNumber = j;
return panelNumber;
j++; //increase our panelcounter
</script>
</head>
<body>
<a href="#" id="previousPanel" onclick="slidePreviousPanel();">Previous Panel</a> |
<a href="#" id="nextPanel" onclick="slideNextPanel()">Next Panel</a> |
<div id="panelwidget" class="SlidingPanels">
<div class="SlidingPanelsContentGroup">
<div class="SlidingPanelsContent" id="p1">Panel 1</div>
<div class="SlidingPanelsContent" id="p2">Panel 2</div>
<div class="SlidingPanelsContent" id="p3">Panel 3</div>
<div class="SlidingPanelsContent" id="p4">Panel 4</div>
<div class="SlidingPanelsContent" id="p5">Panel 5</div>
<div class="SlidingPanelsContent" id="p6">Panel 6</div>
</div>
</div>
<script type="text/javascript">
var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
</script>
</body>
</html>
Gramps -
Sliding Panels Current Panel Navigation
Hi there,
I am quite new to using the spry framework, and my js skills
are not exceptionally strong. I am using a simple navigation menu
to activate the sliding panel widget. I am wondering if there is a
way to target the menu item so I can apply a different style it.
(Different style when panel is active)
Many thanks,
JarvisTake a look at this topic: http://forums.adobe.com/message/2174795#2174795
-
Spry Sliding Panels Question..
Hello,
I'm building a website and want to have a small image gallery page, with Spry Sliding Panels as the framework. Everything was working fine until I realized that in the browser, when I clicked the link to go the next panel, the actual web page itself automatically snaps back up to the top before the panel actually slides. I was wondering how to fix this because the gallery is about halfway down the page, and it looks stupid when the page jumps back up to the top each time. Thanks for your help...Yes, your panel button code (with my change) should look like this:
<div class="panelbtn"><a href="javascript:;" onclick="sp1.showFirstPanel(); return false;">1</a></div>
<div class="panelbtn"><A href="javascript:;" onclick="sp1.showPanel(p2); return false;">2</a></div>
<div class="panelbtn"><A href="javascript:;" onclick="sp1.showPanel(p3); return false;">3</a></div>
<div class="panelbtn"><A href="javascript:;" onclick="sp1.showPanel(p4); return false;">4</a></div>
This is what I meant when I said to replace the # with the word javascript:;
Beth -
Possible to have two occurences of sliding panels in same location on page?
Hi, any help you guys could give me would be greatly appreciated.
I'm redesigning my portfolio page, and am trying to use the sliding panels widget for the two gallery areas. Ideally, when you click the links in the Design area on the left side navigation section, a Sliding Panels Content Group containing all the design work slides should appear on the right side of the page. When you click the links in the Illustration area, a Sliding Panels Content Group containing all the illustration work slides should replace the Design group in the exact same location on the page. Similar to links appearing in an iframe, but without having to click links and upload a page in the frame for each image.
I've managed to get the two different Content Groups to both be on the same page at the same time, like is done with the multiple examples at http://labs.adobe.com/technologies/spry/samples/slidingpanels/SlidingPanelsSample.html, but no luck getting a single Content Group to appear and then be replaced by the second group by clicking one of the links to the left.
Here's the page I'm working with, with only one of the Content Groups active:
http://www.susanmeyerart.com/redesign/
eta: I'm working with Spry Pre-Release 1.6.1.I think you can do this by using Spry Tabbed Panels as your container for the two sets of Sliding Panels. I have not tried this particular nesting before, but if you set up a test page, you can try it out.
Each set of Sliding Panels would appear as content on one of the Tabbed Panels. When each Tabbed Panel Tab is clicked, the corresponding Panel appears, holding your Sliding Panels.
This may not work, but, as they say...you don't know until you try!
Beth -
Edit JS on spry sliding panels widget to fix auto panel height problem
Hi guys,
Ive been trying for a while to make the sliding panels widget
show each panel in its own height instead of the longest panel's height in the container.
I tried reading all the js file to play with it and find a solution but the truth is i dont know how to do what i want.
I do, however, have a list of things that i believe if implemented should work,
could you help me do these fixes on the js? ( any one you know how to or think will work )
1. edit so that: Panels dont have any height ( or panel content display none ) if it isnt current panel. If current panel is "id:1" the assume class 1 style properties. As soon as it looses focus/"currentpanel" class it looses its class 1 properties. And the new current panel ("id:2") assumes its own class 2 properties. And so on.
2. edit so that: PanelContainer ( the one that holds all the panels ) displays none BUT the current panel. So all panels could be display none unless they assume the "currentpanel" class and so they change to display. Maybe this way the container assumes only the height of the displayed panel and looses it once its no longer displayed assuming the next displayed one.
3. edit so that: Panel container checks for current panel's height and assumes that height instantly ( there is still a panel inside the container that would be longer than the current panel, maybe with overflow hidden this isnt a problem )
4. Using SpryDOMUtils.js I am currently playing with the code pasted below,
the idea came from Gramp's Spry Sliding Panels Group Navigation Buttons cookbook
He addresses a different problem, but since it has to do with identifying the current panel and doing something when the panel is x number, i thought there could be a height property set for each panel when each is the current one, atleast something can be done with this, my problem is i dont know how to set that something. Please check out the following code:
<script>
// The following function - setPanelNavigation() - assumes the following
// 1. Sliding Panels have a class of SlidingPanelsContent AND a unique ID
// 2. The Previous Panel button has an ID of previousPanel
// 3. The Next Panel button has an ID of nextPanel
// 4. SpryDOMUtils.js has been linked
function setPanelNavigation() {
var current = sp1.getCurrentPanel(); // Get the current panel
var panelCount = sp1.getContentPanelsCount(); // Get the total number of panels
var panelNumber=1; // Give a value to the first panel number
Spry.$$(".SlidingPanelsContent").forEach(function(node) { // Cycle through the panels
if (node.id==current.id){ // The current panel now receives a number
if ( panelNumber==1 ) Spry.$$(".SlidingPanelsContentGroup").setAttribute('height', 750); //
if ( panelNumber==2 ) Spry.$$(".SlidingPanelsContentGroup").setAttribute('height', 250); //
panelNumber++; // Go to next panel after incrementing the count
Spry.Utils.addLoadListener(setPanelNavigation); // Set buttons to initial value
var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
</script>
What am i doing wrong in that bit ? I thought i had it there, but it didnt work.
Anyone, please help. Thank you.wait my bad, the link to my page is:
http://www.pupr.edu/department/industrial/students.asp
** no s on department -
Linking to a specific SLIDING panel remotely
I'm trying to link to a specific SLIDING panel (not a tabbed
panel) from a remote link. I'm sure this can be done using
SpryURLUtils.js as I've successfully achieved the result with
tabbed panels. There's not as much online information on doing this
with sliding panels, though, and I've had no luck experimenting on
my own.
Can anyone help?
Here are two example pages of the pages in question:
http://www.studiohyperset.com/sandbox/aafd/impressionist.php
http://www.studiohyperset.com/sandbox/aafd/fullsizepgs/impressionist/stillLifeFlowers.htm
The user launches the second page from the first and should
be able to get back to the second sliding panel on the first page
by clicking "RETURN." Right now, when the user clicks "RETURN,"
s/he returns to the first slide in the sequence.
Thanks in advance for any help.http://foundationphp.com/blog/2008/02/09/spry-tutorial-linking-to-a-non-default-panel/comm ent-page-1/
Comment 29: David Powers -
Problem with Accordion Widget INSIDE Sliding Panel Widget
Hello,
perhaps I should not do this, but I nested an Accordion
Widget inside a Sliding Panels Widget:
- There are eight Panels.
- Each one contains a complete Accordion.
The sliding works fine, and so does the Accordion animation,
but the text inside the Accordion Panel Tabs won't move along, when
a tab is activated. I need to hover the mouse over the accordion to
make the panel texts appear again.
Of course, when I un-nest the widgets and move the Accordion
widget out of the Sliding Panel widget, everything is fine.
My question is:
- am I demanding "too much" by nesting the widgets?
- or should this basically work, and the problem arises from
rivalling scripts?
Here is a link:
Nested
widgets Test
The horizontal top menu will activate the sliding panels, but
as of now only the leftmost menu item contains an Accordion (I know
the CSS does not look nice yet).
Is there anything I can optimise to get this to work?
Thank you so much,
Greetings, Jensen
Edit: The problem does NOT occur in Firefox, but in
Safari.Hi John,
That is the expected behavior if the "Overlap items below" is unchecked. Please refer to the following link http://screencasteu.worldsecuresystems.com/aish/2013-08-21_1947.png. If you don't want the page to wiggle up and down, please check the box shown in the screenshot.
Regards,
Aish -
HI,
I am trying to incoperate the "Spry Sliding" feature in my
website.But problem is coming that I have to define the height of
the container of each sliding panel(So,its not giving the
flexibilty) If I am removing the height than the all panels are
showing (So,the effect of sliding panel is lost).
So help me how to define the same feature without the
"HEIGHT".I am using the examples/demos given on the spry offical
website.
Thanks,Yes that sounds about right. As usual I am trying to figure
out ways to have a nice navigation and be able to have a good
amount of copy live on the page and keep the web pages footer
within the viewers browser window. The search continues. -
Sliding panels prev/next buttons
Using graphic buttons for previous and next navigation with Spry Sliding Panels, how can the 'previous' button be dimmed or hidden when you're on the first slide, and conversly, have the 'next' button dimmed or hidden when you're at the end of the slides? Ideally there would be a CSS class added to one button or the other to change states. Or can the Spry Fade Effect be used here to fade the buttons on and off?
The default Spry Widget has no functionality to indicate the current panel. I have created a small hack for that before. You might want to check out this post here: http://forums.adobe.com/message/2175472#2175472
Hopes this helps. -
Trying to come to grips with sliding panels and datasets
Hi there!
I've just started looking into Spry (love it so far!) but
having an issue combining the sliding panels widget and a Spry
dataset. The widget works fine and the dataset works fine when
seperate, but I come up against some problems when I combine them.
As a guide, I've been using the following page:
http://www.pixelz.co.uk/spryArticle.htm
(copy of the article in the Spry Zip file)
and using the Scenario 2 example at the end of the page.
Unfortunately, there were a few bugs in it (like a colon
where there should have been a semicolon and no titles in the
navigation <a> tags at the top) so I did a little debugging
and tied in my own dataset. The code that is running on this page (
http://www.pixelz.co.uk/spryTest.html)
looks like so:
quote:
<head>
<script language="javascript" type="text/javascript"
src="includes/xpath.js"></script>
<script language="javascript" type="text/javascript"
src="includes/SpryData.js"></script>
<script language="javascript" type="text/javascript" >
var dsTest = new Spry.Data.XMLDataSet("data/xmlTest.xml",
"specials/menu_item");
</script>
<script language="javascript" type="text/javascript"
src="includes/SprySlidingPanels.js"></script>
<link href="includes/SprySlidingPanels.css"
rel="stylesheet" type="text/css" />
</head>
<body>
<div spry:region="dsTest" spry:repeatchildren="dsTest">
<a href="#"
onclick="sp1.showPanel('detail{ds_RowID}');">Page
{ds_RowID}</a>
</div>
<div id="sPanel" class="SlidingPanels"
spry:region="dsTest">
<div class="SlidingPanelsContentGroup"
spry:repeat="dsTest">
<div id="detail{ds_RowID}"
class="SlidingPanelsContent">
<h3>{item}</h3>
<p>{description}</p>
<p><strong>{price}</strong></p>
</div>
</div>
<script language="javascript" type="text/javascript">
var sp1 = new Spry.Widget.SlidingPanels("sPanel");
</script>
</div>
</body>
The problem I'm having is that the panels don't change when
the links are clicked. It seems to pull in the data fine, but the
panels dont switch.
When I looked at the generated source, it doesn't look quite
right:
quote:
<body>
<div id="spryregion1" class="">
<a onclick="sp1.showPanel('detail0');" href="#">Page
0</a>
<a onclick="sp1.showPanel('detail1');" href="#">Page
1</a>
<a onclick="sp1.showPanel('detail2');" href="#">Page
2</a>
<a onclick="sp1.showPanel('detail3');" href="#">Page
3</a>
</div>
<div id="sPanel" class="SlidingPanels" style="overflow:
hidden;">
<div class="SlidingPanelsContentGroup" style="left: 0px;
top: 0px;">
<div id="detail0" class="SlidingPanelsContent
SlidingPanelsCurrentPanel">
</div>
</div>
<div class="SlidingPanelsContentGroup" style="left: 0px;
top: 0px;">
<div id="detail1" class="SlidingPanelsContent
SlidingPanelsCurrentPanel">
</div>
</div>
<div class="SlidingPanelsContentGroup" style="left: 0px;
top: 0px;">
<div id="detail2" class="SlidingPanelsContent
SlidingPanelsCurrentPanel">
</div>
</div>
<div class="SlidingPanelsContentGroup" style="left: 0px;
top: 0px;">
<div id="detail3" class="SlidingPanelsContent
SlidingPanelsCurrentPanel">
</div>
</div>
</div>
</body>
I'm not sure, but I think the repeating region is a bit
screwy, but I'm really not sure where to proceed from here.
Any help would be appreciated! Thanks!
GarethRight - fixed it!
<div class="SlidingPanelsContentGroup"
spry:repeat="dsTest">
<div id="detail{ds_RowID}"
class="SlidingPanelsContent">
should have read
<div class="SlidingPanelsContentGroup">
<div id="detail{ds_RowID}" class="SlidingPanelsContent"
spry:repeat="dsTest">
oh well... -
HTML Panel with Tabs like Sliding Panel tabs
Hi, what do I need to add/change to have HTML panels
switching with tabs that switches background image like the tabs in
sliding panels example?
Or can I modify the
sp_withTabs.js to have graphic tabs work with HTML
Panels?Nevermind, I got it. I used the SpryTabbedPanels.js and
modified the SpryTabbedPanels.css with my graphics, size, position
and what not.
I do have one more question. I'm using HTML Panels with Fade
in and out and when loading my page I have to have default content
in the main html doc for something to display when the page loads.
Then when I click on the first button, it then loads the real
external HTML panels. Is there any way I can load my first external
HTML page right when my site loads? -
Hi,
I'm using the sliding panels on my website, but I'm getting
an error when I use a vertical scrollbar.
To the right of the sliding panels I have an image, and when
I press the up and down arrows, the hidden sliding panels are
visible under the image!
Any ideas?
Lukequote:
Originally posted by:
Donald Booth
Hi Spry Users,
We are pleased that you are using Spry!
When posting issues for help, please help us help you.
Providing a URL is the quickest way
for the Spry team, and our valued forum community, to help you with
your page.
Code samples are also great if you
can't provide a URL.
And of course, having the latest code
is always a good idea. Use the latest download if possible.
Questions posted without urls/code inevitably take more back
and forth to get figured out.
And now that this forum has been up for a year and a half, we
have a good record of fixes previously given. Search the forums and
see if your question has been solved already.
Thanks for reading. Now, how can we help you?
The Spry Team
^ else we cant Identify the problem
Maybe you are looking for
-
Phone Model and OS Model - iphone 5 IOS 8.0.2 Problem Description After enabling cellular data, i am receiving mails even if we disable "use cellular data for mail", due to this data usage usage use is more, if we have fix please let me know. Steps:
-
Help :( Skype 7.1 won't stop crashing no matter what I try.
Last night I got a msg to update my skype to version 7.1, so I did that and turned off my laptop. Today I logged on my laptop and logged in Skype, and right after I logged in, not even 30 seconds later, on the home page it comes up with a msg that sa
-
Mac Mini refusing to support res greater than 1280x1024
Hi, I'm trying to set up a Mac Mini for my family, and have been having trouble getting both XP (via bootcamp) and Leopard to support my 24" monitor's native widescreen resolution of 1920x1200. When I go to the Display setup menu the max res it lets
-
I just bought an iphone 3gs 16gb from a friend. He has bought the apple care from AT&T for the iphone before selling the iphone to me. The apple care is up to October, 2011. I have asked apple how to transfer the apple care under my name. Apple said
-
Hi All, I have two products in the SLD, Product1 and Product2, Product1 has SW1 and SW2. All the development is done in the SoftwareComponents of Product1. I need to get the same with Product2, i.e something like assign SW1 and SW2 of Product1 to Pro