Question: Imagine I'm building a blog system where a user can upload images for a blog post. I have a problem mapping the uploaded images with user and their blog post.

Here's the flow :

1. User uploaded some pictures, it's saved to the server.
2. I store the image name in the related table, means later I can
retrieve images by blog's post\_id.

But what if the user upload images that has the same file name?

Answer: 
I have a difficult solution. You can create two `navbar`. second `nav` should be hidden. when you `scroll` more than `150px`, then it should be `fade in` with fixed position. Below my jQuery code is 

```
$(window).scroll(function(){
    var scrolled = $(window).scrollTop();
    if(scrolled>149){
       $('#second_nav').fadeIn();
    }
    else{
        $('#second_nav').fadeOut();
    }
});

```

Below the code is first nav.

```
<nav class="navbar navbar-default">

```

And below the code is second nav.

```
<nav class="navbar navbar-default navbar-fixed-top" id="second_nav">

```

Check my live demo on [jsfiddle](https://jsfiddle.net/sarowerj/64s99gad/)
Are you using jQuery? if so, maybe something like this?

```
$('#div').click(() => {
    $('#div').fadeOut();

  $('#div')
  .css('background-color', 'green')
  .fadeIn();

});

```

<https://jsfiddle.net/53n2o76g/>