Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(".toggle_feed").click(function(){
- // Show Layout Connector
- $(".feed_drop").toggleClass("feed_show").fadeIn(250);
- // Show Main Container for the feed...
- $("#FeedContain").toggleClass("feed_show").fadeIn(250)
- // Show Loader
- showLoadingImage();
- var $feed = $("#Feed");
- // Pull Data
- $.getJSON("./includes/feed.php", function(result) {
- var $elList = $("<ul><li><a><h6></h6><img></a></li><li class='feed_status'></li><li class='feed_date'></li></ul>");
- $.each(result, function(i, data) {
- $elList.find("h6").text(data['user']);
- $elList.find("a").attr("href", "./profile.php?user=" + data['user']);
- $elList.find("img").attr("src", "./includes/objects/thumb_resize.php?fileName=" + data['photopath']);
- $elList.find(".feed_status").text(data['status']);
- $elList.find(".feed_date").text(data['date']);
- console.log($elList);
- $feed.append("<ul>" + $elList.html() + "</ul>");
- });
- hideLoadingImage();
- $("#scrollbar1").mousedown(function() {
- $('#scrollbar1').tinyscrollbar_update();
- });
- });
- // Close the feed onclick
- $(".feed_close").click(function(){
- $(".feed_drop").hide();
- $("#FeedContain").hide();
- $("#Feed").empty();
- });
- $("#scrollbar1").mouseenter(function() {
- $('#scrollbar1').tinyscrollbar();
- });
- // Close the feed whenever you click out of the container.
- $(document).mouseup(function (e)
- {
- var container = $("#FeedContain");
- var containerDrop = $(".feed_drop");
- if (!container.is(e.target) && !containerDrop.is(e.target) // if the target of the click isn't the container...
- && container.has(e.target).length === 0 && containerDrop.has(e.target).length === 0) // ... nor a descendant of the container
- {
- container.hide();
- containerDrop.hide();
- $("#Feed").empty();
- }
- });
- });
- // Loader
- function showLoadingImage() {
- $("#Feed").append("<div id='loading-image'><img src='./graphics/ajax-loader.gif' border='0' alt='Loading...'></div>");
- }
- function hideLoadingImage() {
- $("#loading-image").remove();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement