Results 1 to 5 of 5
- 04-26-2012, 01:19 PM
Thread Author #1
Swipemenu
Sup,
I've been workin on an app mainly for personal use really as I'm not 100% sure about copyright infringements.
Anyway, I'm just trying to add a Swipemenu with a "Home" button on it. I've used some code I found to get the swipemenu working and a home button there. Now how do I make the home button return me to index.html?
I'm pretty new to all this but I'm pretty good with html5 and CSS. I've created te Swipemenu with JavaScript. I say created, I mean cut and pasted from here https://github.com/blackberry/WebWorks-Samples/tree/master/swipemenu
Now I'm assume I need to edit the //define callbacks for menu buttons section to point my home button to index.html.
Im not great with JavaScript so any help would be great thanks - 04-27-2012, 03:23 AM
Thread Author #2
never mind, i figured it out. For anybody else poor with javascript then this is the code i used.
Code:<script> //Define call-backs for menu buttons function doButton() { document.location.href = "index.html"; } </script> - 04-28-2012, 12:27 PM #3
let me know when u figure it out... i was trying to read the script for the swipe menu portion of this and i couldnt understand it for the life of me. I just want the menu to be smaller (in height). I want it to be broken down and easir to read i thin kthere is a lot of excessive lines of code there.
Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage & twitter account - 04-28-2012, 12:38 PM
Thread Author #4
go in the index.html file that comes with the package.
^^this is the bit which defines what the buttons do.Code:<script> //Define call-backs for menu buttons function doButton() { document.location.href = "index.html"; } </script>
^^I imagine if you change the setMenuHeight here it will shrink the menu.Code:<script src="swipemenu.js"></script> <script> window.addEventListener("load", function() { if(swipemenu) { //Optional: override default menu height (default = 70px) swipemenu.setMenuHeight(100);
^^These are the buttons themselves. I think you need to change doButton to different names for each button, then refer to that name in the top section where you define what each button does.Code:swipemenu.addButton("", doButton, true, "http://forums.crackberry.com/images/home-icon.png");
-----------
Here is a link to the app ive been trying to develop myfirstApp - ScummVM Walkthroughs
It shows the slidemenu in action.
I'm just waiting on some replies from the walkthrough authors before i can distribute it.Last edited by Viktor Boskovic; 04-28-2012 at 12:41 PM.
- 04-28-2012, 05:03 PM #5Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage & twitter account

Reply















