Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old January 3rd, 2013, 09:33 AM
stan801003 stan801003 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 159 stan801003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 4 h 20 m 41 sec
Reputation Power: 7
Javascript - Slide button Not working

I have a javascript slide button that once pressed slides down to reveal a google map, however when i click on the slide button nothing moves.

Code:
$(document).ready(function(){
    $('#jobmap').on('click', '.slide', function(){
        $('#panel').slideToggle();
        $('#map').toggleClass('visible');
    });
});​


sliding panel

Code:
  <div id="jobmap">
     <div id="panel">
  <div id="map" style="width: 100%; height: 100%"></div><br />
     </div>
     <p align="right" class="slide"><a href="#" class="btn-slide">View Job Map</a></p>
  </div>


and the CSS

Code:
#panel {display:none; 
        height:600px; 
		width:960px; 
		background:#ccc;}
		
#map {opacity:0; transition(all 0.4s linear); -webkit-transition(all 0.4s linear); -moz-transition(all 0.4s linear); -o-transition(all 0.4s linear);}
 
#map.visible {opacity:1; transition(all 0.4s linear); -webkit-transition(all 0.4s linear); -moz-transition(all 0.4s linear); -o-transition(opacity 0.4s linear);}​

.slide {
	margin: 0;
	padding: 0;
	border-top: solid 0px #fff;
	margin-left:80%;
}
.btn-slide {
	
	text-align: center;
	width: 144px;
	height: 31px;
	padding: 10px 10px 0 0;
	margin: 0 auto;
	display: block;
	font: bold 120%/100% Arial, Helvetica, sans-serif;
	color: #fff;
	text-decoration: none;
}

Reply With Quote
Old January 3rd, 2013, 12:50 PM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,267 IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 30 m 38 sec
Reputation Power: 9
are you getting an error in the developer tools (f12->console)? Nothing stands out as obvious. If you can't figure it out, perhaps a link?

Reply With Quote
Old January 4th, 2013, 06:08 PM
stan801003 stan801003 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 159 stan801003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 4 h 20 m 41 sec
Reputation Power: 7
Hi Thanks I simplified the code a little and added to this page

Link

in the console i now get the following error

Uncaught SyntaxError: Unexpected token ILLEGAL
slidetest2.html:13

Thanks

Lee

Reply With Quote
Old January 7th, 2013, 12:55 PM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,267 IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 30 m 38 sec
Reputation Power: 9
I copied the source and ran it. Had the same error. Went to where it says there is an illegal character and pressed backspace. The cursor didn't move but the script ran just fine. I'm assuming there is an invalid character at the end of the script like a null character that was accidentally inserted.

Reply With Quote
Old January 8th, 2013, 12:07 PM
stan801003 stan801003 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 159 stan801003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 4 h 20 m 41 sec
Reputation Power: 7
OK well i tried the same but it didn't work so i deleted it and wrote the last line again, now i don't get an error, but the panel still doesn't slide open?

Reply With Quote
Old January 8th, 2013, 12:08 PM
stan801003 stan801003 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 159 stan801003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 4 h 20 m 41 sec
Reputation Power: 7
Link

Here is a link to the test page

Reply With Quote
Old January 8th, 2013, 02:46 PM
DavidMR's Avatar
DavidMR DavidMR is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Galway
Posts: 1,369 DavidMR User rank is Private First Class (20 - 50 Reputation Level)DavidMR User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Month 4 h 23 sec
Reputation Power: 8
Code:
<!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>Untitled Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $('#jobmap').on('click', '.slide', function(){
        $('#panel').slideToggle();
        $('#map').toggleClass('visible');
    });
});	
</script>
<style>
#panel {display:none; height:600px; width:960px; background:#ccc;}

#map {opacity:0; transition(all 0.4s linear); -webkit-transition(all 0.4s linear); -moz-transition(all 0.4s linear); -o-transition(all 0.4s linear);} 

#map.visible {opacity:1; transition(all 0.4s linear); -webkit-transition(all 0.4s linear); -moz-transition(all 0.4s linear); -o-transition(opacity 0.4s linear);}?
</style>

<span class="slide">Show</span>
  <div id="jobmap">
     <div id="panel">
  <div id="map" style="width: 100%; height: 100%"></div><br />
     </div>
     <p align="right" class="slide"><a href="#" class="btn-slide">View Job Map</a></p>
  </div>
</div>?
</body>
</html>


works for me...
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car.

Last edited by DavidMR : January 8th, 2013 at 02:49 PM.

Reply With Quote
Old January 8th, 2013, 03:02 PM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,267 IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 30 m 38 sec
Reputation Power: 9
like I said, there is an extra invisible character. I copied and pasted it from my text editor and ran php's ord() function giving me 226. according to http://www.ascii-code.com/, it is "Latin small letter a with circumflex"

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript - Slide button Not working


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap