starting point is example showed on next link:
http://gmaps-samples-v3.googlecode.com/svn/trunk/sidebar/random-markers.html
i added new (second) div panel, and i would like that when end user clicks on one of items showed on left panel, it shows more information about it on new div panel.
so, how can i "read" on which item end user clicked? can i also send post request in background, so it can read data from database (using php)?
thank you in advance!
ok, i manage to solve it....
answer was simple:
$('#sideDetailInfo').html( infoWindow.leftLinkId );
tnx anw!
Related
I want something like when you click on image on facebook, url changes to facebook.com/photo.php?.... but without redirect. I want exactly the same thing but to open the messages, not photos. Simply, i want when user clicks on displayed messages with other users to open a new popup window without redirecting to new page with all messages with that user. Is that possible and if it is please tell me how to do that.
Example:
Messages with user A
Messages with user B
Messages with user C
And when user clicks on 'Messages with user B', it will open new popup window with all messages with that user, and of course, pulled from database.
I decided to write this as an answer since it is too long for a comment.
To "properly" set up what you want, you need several parts working together:
AJAX: (eg: jQuery.ajax) Retrieve data from the server programmatically with javascript
CSS/HTML dialog: (eg: jQueryUI dialog) Create a fake popup inside your page, usually to give the content some prominence
History State: (eg: SO Q/A) Change the page URL (in addressbar) without reloading the page.
I think I understand what you are looking for!
Use case scenario:
1- User looks at a feed of posts/images/anything.
2- User clicks on one of those posts and, it opens in a box with that same content.
The thing you are looking for is called "Lightbox" or "FancyBox".
I googled and found a few examples:
http://fancyapps.com/fancybox/
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
http://lokeshdhakar.com/projects/lightbox/
you basically need to recreate the loop or make on a onclick function when user chooses the photo, and just call the index of that photo again inside the lightbox.
I'm doing a system where the pages are displayed by tabs (easytabs Plugin http://os.alfajango.com/easytabs/#tabs1-js)
At one point in the process it performs a query in the database, where we
see all the details of each item that appears. I'd like to go into the details of the item, click back to the (on broswer or a button) the page to return to the list displayed by the SQL query, just as with any single page, but currently it only displays a blank page.
I wonder how can I do to implement this solution using the layout tabs.
Thank you.
There are various ways to maintain UI state. One of them is using a "url hash". For example, you click tab 2, change the url hash to:
mypage.php#tab=2
Then if someone presses BACK and goes FORWARD, you use JavaScript to look at the URL has and determine that the user had previously pressed tab 2, so you run your own bit of code that triggers the same event.
I'm unfamiliar with "easytabs" so I'm sorry I can't help with the specific implementation details, but that's the gist of the technique.
I am developing a website in php (I am using codeigniter). On search by user I need to display list of products. Search result should give small description about the each product. Once the user clicks on more anchor I need to give full description about the product. Once user clicks back I need to be back to the search result page. I have used pagination. Any suggestion on how to carry out this task. Thanks in advance.
Indeed, this sounds like a job for our good friend Javascript. But not that much - simple history trick would be sufficient in my opinion. Resource:
http://www.javascriptkit.com/jsref/history.shtml
Example:
Go back 3 pages
This sounds like a job for our good friend Javascript. You could do this with a modal window that retrieves a page (such as /product/id/full_description) and displays the full description.
There are many modal window scripts out there that can do this. I am using jQuery and one called SimpleModal (http://www.ericmmartin.com/projects/simplemodal/) and it works well. I am using this since I am already using jQuery for many other things.
Here are some other examples:
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm
http://okonet.ru/projects/modalbox/index.html
http://www.huddletogether.com/projects/lightbox2/
http://orangoo.com/labs/GreyBox/
http://jquery.com/demo/thickbox/
I am working on a CMS for a website using PHP and MySQL and have been asked if it is possible to 'publish' articles just by clicking on a button?
To make things clear, the articles may have already been entered into the database but not identified as being ready for publication. Articles for the site have a column in the db called _'pub'_, which is an ENUM('n','y'). I have created a page which lists all articles by section, article heading, date and published.
If _'pub'_ is 'y', published displays YES, otherwise it displays NO
I have created an additional page that changes the state of _'pub'_ so that it works by clicking on the Yes or No for published, but wondered if there was a way of changing the status of _'pub'_ using javascript rather than an additional page.
I look forward to hearing any suggestions
Just use jquery like this
$.post("/submit.php","title='Title of post'&content='PostContent'", function(d){
$(".output").html(d);
});
What that basically does is, sends the content to submit.php with ($_POST['title'] and $_POST['content']).. and then returns the output in a div with the classname output
And everything happens with a single click on the same page
You want the users to stay on same page, is that it?
Use ajax/jQ to:
submit articleid that should be published
on request-completion, change image/text in list from "no" to "yes"
http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/
is a good start.
regards,
//t
I have a menu, it contains multiple items, each menu item will retrieve data from the database.
I want to do it without the page refresh, I want like an area that will change when the user clicks on the menu link.
How should I send data to the php script and how should I get it from there and preview it on the page?
If you can send me any information, references or examples that will be great.
Thanks in advance.
I would start by reading some of the documentation from the jQuery website:
http://api.jquery.com/category/ajax/
This might also be of interest to you:
http://articles.sitepoint.com/article/ajax-jquery