×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: sliding tab behind infowindow

sliding tab behind infowindow 12 years 6 months ago #15996

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

I am trying to create a sliding tab behind info windows. Once the user click on an image inside info windows, the sliding tab is showing some information that could be a YouTube video, an image, etc.

The problems:
- Anything inside the info windows will be displayed in the sliding search tab from the right.
- I tried to use JavaScript code inside the info windows, and I found the above problem plus the javascript code disappear. I tried different ways and different joomla editors with the same result.
- I also tried to find a joomla component or plugin for this, and I didn't find anything so far.

Any ideas or suggestions?

Re: sliding tab behind infowindow 12 years 6 months ago #15997

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Eliecer,
I'll need a little more info to be able to get into your head and figure out what you are trying to do

So when you click something in the infowindow you want to create a new tab in the sliding menu on the right and show some more info there???

Cheers,
Daniel

Re: sliding tab behind infowindow 12 years 6 months ago #15998

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Ok, let me use images to show what I meant.

Let me start with the image1


As you can see, there is a set of icons inside the infowindows, and let's say that I click on the first one to your left.

A panel will slide from behind the infowindow showing a video (in this case)

Re: sliding tab behind infowindow 12 years 6 months ago #16000

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Eliecer that looks really cool!!!

About the sliding panel - I think it is a great idea, but I really doubt it that it is easily achievable.
We currently use the standard google maps infowindow and it is difficult to change the way it works. So sliding that video panel from behind the infowindow in my opinion will be only possible if you create your own infowindow, but it is not that easy.

For your example why not go with overlays? When the user clicks on the video you dim the screen and show the video in the middle? This could work exactly as your 360° panaroma view?

Daniel

Re: sliding tab behind infowindow 12 years 6 months ago #16009

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi Daniel,

I don't think it's too hard to accomplish. The complicated part could be to integrate it with hotspots, and you are the one knowing every single corner of hotspots.

Check these 2 links:

http://www.learningjquery.com/2009/02/slide-elements-in-different-directions

http://www.switchonthecode.com/tutorials/javascript-sliding-panels-using-generic-animation

I was not suggesting to change the way infowindows works, the trick is make this sliding panel looks like part of infowindows. The panel doesn't have to slide from behind the infowindows, but we can create the illusion.

Re: sliding tab behind infowindow 12 years 6 months ago #16010

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hi Eliecer,
Don't get me wrong - I'm not saying that making a sliding effect is difficult -> I'm saying that making it into the current format of the infowindow is difficult.

Look at this code:
 
if(this.options.showDirections.toInt()) {
			direction = new Element('span', {
				id: 'getDirections',
				html: this.locale.directions,
				'class' : 'link',
				events: {
					click: function() {
						document.id('direction-form').setStyle('display', 'block');
						google.maps.event.trigger(self.infoWindow.infoWindowObj, 'content_changed');
					}  
				}
			});
		}

Basically this is a trick for the directions. When you click on a marker the direction-form is set to display: none. When you click on the direction form we set the css of the form to display: block. And then we tell google maps that we've changed the content of the infowindow -> and it changes the dimentions of it. So maybe you can try the same there???
Add a hidden div with the video, on click show it and tell gmaps that the content in the infowindow has changed, so that it can change the dimentions of the div.

Making animation in the infowindow is hard -> you need to controll the dimentions of the divs and I've tried in the past and I have failed -> you don't have css classes, the divs are not nested, the div for the infowindow is actually not a single div, but like 20 that are glued together. (just look at the structure with firebug).

My best advise is - try it with showing it and not sliding it.

Hope that I was able to bring you in the right direction.

Daniel

P.S. Check this book out: www.amazon.com/JavaScript-MooTools-Exper...pment/dp/1430230541/ It is good for novices and advanced developers. You'll certainly learn more about JS than just from copy pasting snippets on the internet.

Re: sliding tab behind infowindow 12 years 6 months ago #16020

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
I've been trying by myself, but I can not include javascript code in any field inside hotspots. I tried different ways and different joomla editors with the same result.

Do you have any suggestion?

Re: sliding tab behind infowindow 12 years 6 months ago #16051

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
I went to Content/Article Manager/Parameters (joomla 1.5)

and I select:

Filter type: Whitelist
Filter tags: script

I create a new article containing a javascript code:
<script>
  document.write("Hello World!")
</script>

The full javascript code stays in the article without trouble at all.

I tried to do the same inside hotspots

The javascript code disappeared.


How can I fix that to allow the use of javascript code inside hotspot?

Re: sliding tab behind infowindow 12 years 6 months ago #16052

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Did you try to add it from the backend or frontend?
Is the WYSIWYG editor turned off? It also strips those tags before you submitting.

Re: sliding tab behind infowindow 12 years 6 months ago #16053

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi Daniel,

I went to Components / Hotspots / Locations(hotspots)

to select one of the hotspots.

I entered the javascript code in the short description field. I saved it.

I re-opened the hotspot and the <script> tags are gone.

I am using - No Editor.


But if I insert the javascript code inside a joomla article, the code stays there.

Re: sliding tab behind infowindow 12 years 6 months ago #16063

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
any ideas why hotspots is not letting me write javascript code inside the short description field?

Re: sliding tab behind infowindow 12 years 6 months ago #16068

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Yes, in a matter of fact I have! Javascript has nothing to do in the artilce, but if you really wish to have it, then here is what you need to do.
Go to administrator/components/com_hotspots/controllers/hotspots.php

on line 127:
		$filter	= new JFilterInput(array(),array(),1,1,1);
		$row->description	= $filter->clean( $description );
		$row->description_small	= $filter->clean( $descriptionSmall );
change it just to
$row->description	=  $description ;
$row->description_small	= $descriptionSmall ;

This way you won't strip any code from the descriptions and they should be saved 1 to 1 as entered on the page.

May I ask why are you trying to do this? And I don't think that when you load the markers on the map( this happens in ajax) that the document.write will do anything to the infowindow -> as javascript contained in the response is not executed.

Are you still trying to create the sliding tab???
Daniel

Re: sliding tab behind infowindow 12 years 6 months ago #16081

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
So? did you manage to get it to work?
Daniel

Re: sliding tab behind infowindow 12 years 6 months ago #16086

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi Daniel,

Yes, I'm still trying to create the sliding tab.

I am not losing any javascript code anymore inside the description field, but the code is not executed.

I tried the following javascript code to test it, an nothing happened.

http://www.w3schools.com/js/tryit.asp?filename=tryjs_function1

Re: sliding tab behind infowindow 12 years 6 months ago #16124

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Eliecer,
Let me try to explain what you normally should do and then you can decide if you want to do it my way or your way.

You should not put javascript in your text. Why? Well, because of the same reason we don't mix presentation with business logic. Because of the same reason that we style our pages with css and don't put inline styles over the place.

If I was on your place I would use delegation!
mootools.net/docs/core/Element/Element.Delegation
Delegation is part of the mootools core in 1.3 and 1.4. In mootools 1.2.5 you need to add the mootools-more classes.

Here is an example of delegation in action:
jsfiddle.net/compojoom/QsHw4/2744/

The first part is the actual ajax Request. It returns the following string:
"<div id="myid"><span>click me!</span> some text</div>"

Now look in the show response function. I create a new element - a div . The content of the div is going to be the response of our ajax request. The I attach an event to this div:
    div.addEvent('click:relay(#myid span)', function(){
        alert('clicked');
    });

the :relay tells the event to only be executed when I click on span elements in a div with id #myid.

On the right in jsfiddle you have the result. When you click on the click me text -> you should get an alert in the browser. When you click on some text nothing will happen. So in this case you don't have any javascript in the code, but you are executing events.

But again - stay away from the standard infowindow in google maps! I wasted 4h today trying to figure out why the infowindow was smaller than the content when I was creating the dashboard in hotspots!!!

In the past I have discovered, that when I add content to the infowindow, the best thing to do would be to wrap this content in a div and set the height of that div. This way the infowindow is normally bigger than the content. But today my infowindow was smaller than than the div. No matter what height I was setting the height of the infowindow was with 160px smaller than my content...

At the end it turned out that if you have a map that is 300px high, no matter what you do, you can't get the size of the infowindow to be bigger than 140px... If you have a map that is 600px high - you can't have the info window height bigger than 300 something - this is all automatically calculated by google. No matter if you call the content_changed events for the infowindow or not... So my advise is really - stay away from it and just show the information somewhere else. Like in an overlay on the whole page or left from the map etc... Just use the infowindow to show a little content with few buttons...

Cheers,
Daniel
  • Page:
  • 1
Time to create page: 0.138 seconds